Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Readme #1685

Merged
merged 4 commits into from
Nov 26, 2024
Merged

Updated Readme #1685

merged 4 commits into from
Nov 26, 2024

Conversation

davemfish
Copy link
Contributor

@davemfish davemfish commented Nov 13, 2024

Added notes on Python environment and natcap.invest installation.
Added notes on how we link to external repos, sample-data, test-data, and User's Guide.

Some other small sections were removed because they were out of date.

Fixes #670

It looks like all the tests are failing for an unrelated reason (see #1686 ) so I'm not going to address that in this PR.

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
  • Updated the user's guide (if needed)
  • Tested the Workbench UI (if relevant)

Copy link
Member

@emilyanndavis emilyanndavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @davemfish, this is a vast improvement! Just had a few small suggestions.

In practice, it can be convenient to use an "editable install" instead to avoid needing
to re-install after making changes to source code::

$ pip install -e .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Took me weeks to figure this out 🤣

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me years!


$ make install

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a note here about the need to uninstall before reinstalling. Something along these lines:

To update your local installation after making changes to source code::
    $ pip uninstall natcap-invest
    $ make install

This'll get you unstuck if you (intentionally or unintentionally) use make install, and it underscores why an editable install (described next) is so compelling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I almost added this. For a long time my routine was pip uninstall -y && make install but then I questioned whether the uninstall was actually necessary. But I think you're right, sometimes it is and it never hurts, so this should be described here.

README.rst Outdated

$ pip install -e .

But note that any changes to non-Python files will still require compilation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be worth explaining what this means in practice, i.e., if I've changed non-Python files, do I need to uninstall and reinstall natcap.invest?

README.rst Outdated

$ pip install -e .

But note that any changes to non-Python files will still require compilation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add a parenthetical: non-Python files (excluding the workbench), just to avoid confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding a note to explain that the workbench is not part of the natcap.invest python library.

README.rst Outdated
@@ -145,6 +153,13 @@ To build the user's guide::
This will build HTML and PDF documentation, writing them to ``dist/userguide``
and ``dist/InVEST_*_Documentation.pdf``, respectively.

The User's Guide is maintained in a separate git reporsitory. InVEST will build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is admittedly fun to say reporsitory, but we should probably fix the typo anyway. 😃

@davemfish
Copy link
Contributor Author

Thanks @davemfish, this is a vast improvement! Just had a few small suggestions.

Thanks for the suggestions, @emilyanndavis. I pushed some changes.

Copy link
Member

@emilyanndavis emilyanndavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Copy link
Contributor

@claire-simpson claire-simpson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I left a small comment tangentially related to your changes but tbd if its relevant

README.rst Outdated
manage your own virtual environment. ``requirements.txt``,
``requirements-dev.txt`` and ``requirements-docs.txt`` list the python
dependencies needed.
This makefile target is included for convenience. It uses ``conda`` and installs packages from ``conda-forge``.

Using a different environment name
""""""""""""""""""""""""""""""""""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be more correct to use folder or directory instead of name as the environment is referenced by its path rather than name? I.e., conda activate ./env rather than conda activate env. Maybe this is a me problem but the only way I could get a named environment was to specify ENV=path/to/miniconda/base /myEnv

Copy link
Contributor Author

@davemfish davemfish Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think you're right. Since the env target of the Makefile calls conda like this:

$(CONDA) create -p $(ENV)

It's using the -p flag, so ENV will always be interpreted as a path to a directory.

Maybe this is a me problem but the only way I could get a named environment was to specify ENV=path/to/miniconda/base /myEnv

That makes sense; not a you problem. I guess make env was designed with the opinion that prefixed environments are a good idea. But creating our own environments in whatever way we prefer as individuals is also a good idea!

@davemfish davemfish merged commit 68bf602 into natcap:main Nov 26, 2024
20 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InVEST Readme could use a refresh
3 participants