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

Add an external script to conda-package planar_hex #256

Merged
merged 1 commit into from
Jun 4, 2019

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented May 17, 2019

In #248, planar_hex was moved into the conda-package for MPAS-Tools. However there is also a need for an external version of the tool. This PR adds a stub script called planar_hex that calls the code in the conda package. (The stub script is copied from a conda environment and is the same approach used to access entry points into python packages used elsewhere.)

@xylar
Copy link
Collaborator Author

xylar commented May 17, 2019

@matthewhoffman, could you see if this works for you?

@xylar
Copy link
Collaborator Author

xylar commented May 17, 2019

@matthewhoffman, my preferred way of having planar_hex used would be for you to either use the compass_py3.7 environment that I set up on IC:

source /usr/projects/climate/SHARED_CLIMATE/anaconda_envs/base/etc/profile.d/conda.sh
conda activate compass_py3.7

or if there are packages you need that aren't in that environment, include mpas_tools in your own conda environment:

conda create -n my_awesome_env -c conda-forge python=3.7 mpas_tools numpy scipy netcdf4 ...
conda activate my_awesome_env

In either of these cases, planar_hex and several other MPAS tools are in your path. Plus you can use the mpas_tools python module to access a bunch of stuff in your scripts.

But I think it makes sense to have the option to just run planar_hex it out of the repo for those with a different (dare I say outdated) workflow.

@matthewhoffman
Copy link
Member

@xylar , thanks for addressing this. Frankly, I'd be ok with moving to the conda env approach to using tools in a workflow - I just need to get myself up to speed on that. I'm curious about why this tool ended up in the conda directory whereas all the others are still standalone scripts, but I can probably wait until next time I see you to get the explanation.

@xylar
Copy link
Collaborator Author

xylar commented May 17, 2019

I'm curious about why this tool ended up in the conda directory whereas all the others are still standalone scripts, but I can probably wait until next time I see you to get the explanation.

I'd personally move all the tools to the package but I don't feel like I "own" any of them but the ones I wrote recently. I figured planar_hex as new enough that no one had really had time to work it into their workflows, whereas others would take awhile before the conda environment was the primary way that they're used. I essentially gutted a lot of the ocean tools and just left stub scripts behind, a bit like what I've now done for planar_hex but that approach is clumsy and it's better if people know to look in the conda package instead. Ideally, I'd like to do the same with land-ice tools but the only think that's really required is converting them to python 3.

@xylar
Copy link
Collaborator Author

xylar commented Jun 2, 2019

@matthewhoffman, could you test and approve this at your convenience so I can merge it?

Copy link
Member

@matthewhoffman matthewhoffman left a comment

Choose a reason for hiding this comment

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

@xylar , thanks for putting this together. I played around with it and it serves my need of a standalone way to run planar_hex. In the long run we can decide to what extent we want/need to support such a workflow, but for now it is very helpful.

@xylar
Copy link
Collaborator Author

xylar commented Jun 4, 2019

Great, thanks for trying it out and for the helpful discussion.

@xylar xylar merged commit 7c21416 into MPAS-Dev:master Jun 4, 2019
@xylar xylar deleted the external_link_to_planar_hex branch June 4, 2019 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants