-
Notifications
You must be signed in to change notification settings - Fork 52
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
Access the mpas_analysis package with an "entry point" #477
Conversation
I have tested this with a simple QU240wLI test case using the repo (i.e. |
01d758f
to
8f0c2ff
Compare
To call run the analysis, now do: python -m mpas_analysis ... Once built, the package can be run with: mpas_analysis ... download_analysis_datay.py now points to a function in __main__.py
These include config.default, AnalysisTask and its test
and job scripts
and its generation code.
8f0c2ff
to
5f8b4a5
Compare
It should be possible to do a test install of the conda package built from this branch using: conda create -n mpas_analysis_1.1_py3.6 -c conda-forge -c xylar python=3.6 mpas_analysis=1.1
conda activate mpas_analysis_1.1_py3.6
mpas_analysis config.<run> |
It isn't recognized as an installed package by setuptools
After a few rebuilds (removing nco and adding some missing XML files to setup.py), the conda package seems to be working, too. |
@jhkennedy, if you would be willing to take a look at this when you have time, I think it's ready for a review. If you want to actually test it on a run, there are example runs pointed to in the @milenaveneziani, would you be willing to run a test, once with the git repo (as usual) using the |
@xylar with a cursory glance it looks great! I'll look at it in depth tomorrow -- I should be able to test it on a run. |
yes, I'd really like to run a couple of tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xylar Everything looks pretty good to me!
I just have some minor comments:
-
You are currently testing MPAS-Analysis with python 2.7, 3.5 and 3.6, but you only list 2.7 in the setup file: https://github.com/xylar/MPAS-Analysis/blob/add_entry_point/setup.py#L44-L46 . Are you not officially supporting python 3?
-
When you fork the conda-forge recipe for MPAS-Analysis, you'll want to make sure you list you entry-point in that meta.yml here: https://github.com/xylar/MPAS-Analysis/blob/add_entry_point/conda/recipe/meta.yaml#L10 . I'm not sure if that's needed for your e3sm_unified builds.
Thanks @jhkennedy, those are helpful comments and very easy to address.
|
This merge also adds the entry point to the conda recipe
@xylar: I have been trying to run MPAS-Analysis on cooley but I am having trouble (I will report on the changes I had to make in order for the batch job script to work once I am successful..). Please bear with me for another day or so. thanks. |
@xylar: MPAS-Analysis is finally working again for me on cooley (although there are some changes that we need to apply to the batch job script: I will open a quick PR for this). Now I want to use it as a conda package, but before doing that: is there an easy way to use/install the e3sm-unified packages in my conda environment? Or do I just list all packages under e3sm-unified and install them under my conda? |
Or should I just push the new job_script.cooley.bash to this branch? |
As long as you think this PR is close to being merged, let's just update the Cooley job script in this PR.
This might be easiest to discuss in person. I'll come by really quick. |
@xylar: the conda package works just fine. I installed it with no problems in my own ocnda.
don't know if you care. From my point of view, you can merge this. ps: there was already a config file available for the high-res on alcf, so we are good about it. I just updated it for the parallelTasks issue. |
@milenaveneziani, thanks so much for your careful testing! The warning you saw is really annoying but nothing to worry about. I suspect that it has to do with building numpy with one library and running it with another but I see that warning on every machine I use with the latest version of numpy. |
This means that the
run_mpas_analysis
script has been removed and its functionality has been moved tompas_analysis/__main__.py
. Whenmpas_analysis
is installed as a conda package, there will be anmpas_analysis
script in the path (as well as adownload_analysis_data
script) in the path. When users want to run the analysis from the repo rather than the package, they will need to use:instead of
./run_mpas_analysis ...
. Nothing else about execution has changed (e.g. all flags work as before).The documentation, comments, scripts and example config files have been updated to reflect the change.
Reason for this change
In order to move over to conda-forge instead of building the mpas_analysis package ourselves for each release, we need to have an entry point rather than a script. An entry point also allows us to call the main script the same thing as the package (
mpas_analysis
), which is less clunky than adding "run" to the front just to prevent conflicts.closes #452