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

Change API for PCRGlobWB model class #85

Merged
merged 26 commits into from
Jun 21, 2021
Merged

Conversation

Peter9192
Copy link
Collaborator

@Peter9192 Peter9192 commented May 17, 2021

  • Added PCRGlobWBParameterSet and PCRGlobWBForcing classes
  • Changed the constructor to accept version, parameter_set and forcing inputs
  • Update the example/test notebook to reflect the updated API
  • Reduce the number of configurable parameters and use an "ewatercycle" flavour instead of just exposing the model config.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Peter9192 Peter9192 marked this pull request as ready for review May 20, 2021 07:14
@sverhoeven sverhoeven self-requested a review May 21, 2021 08:37
Copy link
Member

@sverhoeven sverhoeven left a comment

Choose a reason for hiding this comment

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

Started with reviewing.
I have some small inline suggestions.
Still need to run notebook.

ewatercycle/models/pcrglobwb.py Show resolved Hide resolved
ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
examples/pcrglobwb.ipynb Show resolved Hide resolved
examples/pcrglobwb.ipynb Show resolved Hide resolved
Copy link
Member

@sverhoeven sverhoeven left a comment

Choose a reason for hiding this comment

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

Was able to run notebook with a extra manual command. Can command be added to notebook?

Copy link
Member

@sverhoeven sverhoeven left a comment

Choose a reason for hiding this comment

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

The forcing paths are not correctly resolved into the config file. Could you have a look at that?

ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
@Peter9192 Peter9192 requested a review from sverhoeven June 10, 2021 15:03
@Peter9192
Copy link
Collaborator Author

@sverhoeven made some more changes, a.o. I reduced the number of configurable parameters (discussed with Niels a while ago). Could I bother you with another round?

Copy link
Member

@sverhoeven sverhoeven left a comment

Choose a reason for hiding this comment

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

Notebook works.

If have some inline questions/suggestions

ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
ewatercycle/models/pcrglobwb.py Outdated Show resolved Hide resolved
raise ValueError(
"Couldn't spawn the singularity container within allocated"
" time limit (15 seconds). You may try building it with "
f"`!singularity run docker://{self.docker_image}` and try "
Copy link
Member

Choose a reason for hiding this comment

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

When I got this exception in the example notebook, the building of the Singularity image kept going (as evident from the Jupyter log). So I let that complete and then ran setup again.

The singularity run docker://ewatercycle/pcrg-grpc4bmi:setters will run forever as it starts a BMI server. My suggestion would be to run singularity exec docker://ewatercycle/pcrg-grpc4bmi:setters run-bmi-server -h as it will show some help and then immediately exit.
Also having a ! assumes that the error was thrown in a notebook. I don't think its wise to presume that and would remove the !.

The last sentence assumes the system admin has diverted the SINGULARITY_CACHEDIR to a shared location instead of the default ~/.singularity. This is not possible according to https://singularity.hpcng.org/user-docs/3.7/build_env.html#sec-cache

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Aii, that's a good point. Maybe we cannot use the docker:// syntax after all then, if we want the admin to manage the containers on the system.

For now I've wrapped the whole container startup in a try/except block and adapted the message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@sonarqubecloud
Copy link

Copy link
Member

@sverhoeven sverhoeven left a comment

Choose a reason for hiding this comment

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

LGTM

@Peter9192 Peter9192 merged commit 937311d into master Jun 21, 2021
@Peter9192 Peter9192 deleted the pcrg-new-constructor branch June 21, 2021 08:28
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.

2 participants