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 marrmot M01 model class #56

Merged
merged 20 commits into from
Apr 21, 2021
Merged

Add marrmot M01 model class #56

merged 20 commits into from
Apr 21, 2021

Conversation

SarahAlidoost
Copy link
Contributor

No description provided.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@sverhoeven sverhoeven changed the title Add marrmot model class Add marrmot M01 model class Apr 19, 2021
@sverhoeven sverhoeven marked this pull request as ready for review April 19, 2021 13:24
@sverhoeven sverhoeven marked this pull request as draft April 19, 2021 13:41
@sverhoeven sverhoeven marked this pull request as ready for review April 19, 2021 14:02
@nielsdrost nielsdrost self-requested a review April 20, 2021 15:07
Copy link
Member

@nielsdrost nielsdrost left a comment

Choose a reason for hiding this comment

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

Nice work @SarahAlidoost and @sverhoeven !

The get_value_as_xarray function seems to only work on flux_out_Q. With both P and T it crashes. Is this "future work"? :-)

Other than that good to go, so feel free to merge (perhaps add an issue on the limited use of get_value_as_xarray)

"""
if work_dir is None:
scratch_dir = CFG['output_dir']
# TODO this timestamp isnot safe for parallel processing
Copy link
Member

Choose a reason for hiding this comment

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

This is going to be a problem quickly. Perhaps add milliseconds to kick the can down the road?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I was working with marrmot calibration and parallel processing, I found that this solution does not work because the CPU time would be the same for all cores. We added a random filename generator there.

Copy link
Member

Choose a reason for hiding this comment

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

Created #67

@nielsdrost
Copy link
Member

Sonarcloud is complaining about duplicate lines in test code. I guess we should either fix or ignore test code in quality verification. @sverhoeven do you know what the approach usually is?

@SarahAlidoost
Copy link
Contributor Author

Nice work @SarahAlidoost and @sverhoeven !

The get_value_as_xarray function seems to only work on flux_out_Q. With both P and T it crashes. Is this "future work"? :-)

Other than that good to go, so feel free to merge (perhaps add an issue on the limited use of get_value_as_xarray)

Thank you @nielsdrost. I made issue eWaterCycle/ewatercycle-marrmot#6 and added a TODO and NotImplementedError to the function.

@sverhoeven
Copy link
Member

Sonarcloud is complaining about duplicate lines in test code. I guess we should either fix or ignore test code in quality verification. @sverhoeven do you know what the approach usually is?

Sonarcloud does not report duplication in test code only in ewatercycle/models/marrmot.py. I would not change the gate, but do some work after EGU to lower code duplication and increase coverage.

The get_value_as_xarray method should be moved to a super class, as all models we currently have can use same method. However later we will get some models that will not be able to return xarray due to their grid type. So we might need a sub class of AbstractModel to handle implement get_value_as_xarray and the models can be subclasses of that one.

@sonarcloud
Copy link

sonarcloud bot commented Apr 21, 2021

@sverhoeven sverhoeven merged commit c2c4839 into master Apr 21, 2021
@sverhoeven sverhoeven deleted the add_marrmot_class branch April 21, 2021 08:48
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.

3 participants