-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update installation instructions #95
Conversation
@ashjbarnes the readme mentions:
Is this the most updated latest recommendation? Why do people need to clone the repository? Just to get the notebook? They can simply download just the notebook, right? |
For example, users can easily download the notebook from https://regional-mom6.readthedocs.io/en/latest/demo_notebooks/reanalysis-forced.html There is a button at the top right. |
The reason for the confusion is partly that some of the functionality requires the Anyway, my workaround has been that the |
OK, I see. Is this premade run directory big in size or just few text files etc?
Hm... well if that's what needed we need to explain it. Or give a step-by-step instructions. |
No the
No it's a really small size on disk. I think ideally the |
But where would |
An old implementation of this was to use a relative path from the regional-mom6.py file. This was something like Path(file).parent / "demos". That works when you git clone the repository and then import from there, but doesn't work if you pip install (currently) because the demos folder isn't included. However, if we could guarantee that the files were included in the pip install, we could hardcode the correct relative path again in the |
As a user, do I need to have this |
no. the |
gotcha! |
See https://github.com/COSIMA/regional-mom6/tree/angus-g/package-data-install for how to include the demos in the package wheel. |
So @angus-g, if we do what f064842 suggests then this issue with the "premade_run_dir" that @ashjbarnes mentions above is taken care of? |
Right, then from within the module code, |
That sounds good! OK, I did it. @ashjbarnes try this whenever and if it works fine then we can simplify the installation instructions! |
As it was, installing via It also checks for the existence of this folder. If it can't find it, then it prompts the user to install via a clone of the repo so that the demo material is present |
Only thing I can think is that |
sorry for all the commits... I haven't found a good way to test the workflow locally yet. I've tried to do what @angus-g suggested but it just says that there's 'no such module'. |
Feel free to commit as much as you like!! |
Ok so the solution was to explicitly include all of the subdirectories of premade_run_directories. I'm still perplexed why doing a fresh install on a new conda env on gadi worked, but not within the docker container on github actions. Anyway I guess this is more robust! |
I've updated the install instructions so they no longer imply the need to git clone and then install to access the premade rundirs |
Ok. Great! good job figuring it out!! |
It’d be nice if @angus-g’s pair of eyes had a look at this before we merge. |
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.
Looks pretty good. I guess there's still the outstanding change to avoid recommending a clone. Otherwise, just a few places where os.path
should be replaced by pathlib directly.
"regional_mom6.demos" = "demos" | ||
|
||
[tool.setuptools.package-data] | ||
"regional_mom6.demos.premade_run_directories" = ["**/*"] |
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.
Ah, nice catch. I think this probably depended on the setuptools version, but this is definitely more robust!
) | ||
print(overwrite_run_dir) | ||
if surface_forcing != False: |
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.
Why not:
if surface_forcing != False: | |
if surface_forcing: |
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.
Good catch @angus-g. Hm... @ashjbarnes, by writing if surface_forcing != False
will execute if surface_forcing = nothing
or surface_forcing = "silly_forcing"
. Was this intentional?
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.
OK, @angus-g I see that how this method is called surface_forcing
could be indeed a string "era5"
.
So what @ashjbarnes did here is intentional.
It is prone for mistakes though since, at least myself, when I see a variable that can be False
I assume it's a boolean so True
or False
are the only allowed values. I'll open an issue and we can discuss there and fix in a different PR.
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.
see #134
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.
I think in that case it should be a string value or None
.
Co-authored-by: Angus Gibson <[email protected]>
Co-authored-by: Angus Gibson <[email protected]>
Some rewording. Hopefully it's an enhancement.