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

[ESMpy] Guess esmf.mk locations #151

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

aulemahal
Copy link
Contributor

This fixes #117 and should adress conda-forge/esmf-feedstock#91 and many issues on xESMF.

This adds a "guessing" snippet to loadESMF.py for cases when the ESMFMKFILE env var is not set.

The new behaviour in 8.4 was to depend on the env variable. The ESMpy conda package was updated so that this env var is set upon environment activation. However, there are many cases in which a conda env is used without being activated:

  • when used as a kernel in a jupyter lab/notebook instance
  • when used to build documentation on ReadTheDocs
  • when used as a kernel in some fancy IDEs (PyCharm for example)

This new behaviour generated many issues in xESMF, raised by users who do not really know about the mechanics of ESMF/ESMpy. This PR is in part to help those users, who rely on the "out-of-the-box" aspect of conda.

The two paths I added to the guessing are the same that ESMpy already guesses in its conda recipe. See: https://github.com/conda-forge/esmpy-feedstock/blob/60527fe641e89da9e2ab0b3f93a5b6f67a0d20f8/recipe/scripts/activate.sh#L11-L15

Thus I am suggesting replicating the "guessing" part from ESMpy's conda configuration directly in its code.

I also removed a few lines from the documentation. Unless I am mistaken, installing ESMpy from source does not require the esmf.mk file anymore, no?

Copy link
Contributor

@rokuingh rokuingh left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for this excellent contribution @aulemahal!

@theurich
Copy link
Member

@rokuingh and @billsacks - should this still go into release/8.5.0? If you think so, it is okay with me. Just change the target of this PR and let me know. Thanks.

@billsacks
Copy link
Member

I would vote for including this in the 8.5.0 release since it's tripping up users of ESMPy. @rokuingh do you agree?

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.

Default mechanism for finding ESMFMKFILE in esmpy
4 participants