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

New GSIM Idini2017 #6666

Merged
merged 13 commits into from Apr 12, 2021
Merged

New GSIM Idini2017 #6666

merged 13 commits into from Apr 12, 2021

Conversation

pheresi
Copy link
Contributor

@pheresi pheresi commented Apr 2, 2021

  • Implements Idini et al (2017) gsim, including its test and verification tables
  • Includes soiltype into site.py and adds it in site_test.py and oqvalidation.py

Implements Idini et al (2017), its test and test tables
Includes soiltype into site.py and adds it in site_test.py and oqvalidation.py
@micheles micheles requested a review from mmpagani April 6, 2021 08:56
@micheles micheles added this to the Engine 3.12.0 milestone Apr 6, 2021
@micheles
Copy link
Contributor

micheles commented Apr 6, 2021

Since you are extending the site model we also need an end-to-end test using a site model with soiltype. You can copy what has been done in openquake/qa_tests_data/classical/case_37 for the siteclass parameter.

@pheresi
Copy link
Contributor Author

pheresi commented Apr 6, 2021

Oh ok, perfect. Should I create a new case (case_38) from case_37, and include it in this pull request, or create another one?

@pheresi
Copy link
Contributor Author

pheresi commented Apr 6, 2021

Oops... just saw that there is already a case_38... So well, I mean case_63

@micheles
Copy link
Contributor

micheles commented Apr 6, 2021

You can create a new test case or update an existing one to use soiltype, as you prefer.

@micheles
Copy link
Contributor

micheles commented Apr 7, 2021

You are probably doing more work than needed. Adding soiltype should be a single line. See for instance this PR that is adding
the site parameter bas: https://github.com/gem/oq-engine/pull/6672/files (NB: I left case_63 free for you ;-))

@pheresi
Copy link
Contributor Author

pheresi commented Apr 7, 2021

Sorry, sorry... yesterday I couldn't work on this, but I'll do it today.

@micheles
Copy link
Contributor

micheles commented Apr 8, 2021

There are some conflicts to resolve, for the rest LGTM

@pheresi
Copy link
Contributor Author

pheresi commented Apr 8, 2021

Oh, right. I'm going to resolve those in a bit. Thanks for the reminder!

@pheresi
Copy link
Contributor Author

pheresi commented Apr 8, 2021

Hi again,
The engine check failed in case_13 of classical PSHA. Should I just add "soiltype" to the .csv file where it failed?
Also, the hazardlib check failed while installing dependencies, but I'm not sure why. Can you help me with this one?
Thanks!

@@ -252,6 +253,7 @@ def from_points(cls, lons, lats, depths=None, sitemodel=None,
self._set('z2pt5', sitemodel.reference_depth_to_2pt5km_per_sec)
self._set('siteclass', sitemodel.reference_siteclass)
self._set('backarc', sitemodel.reference_backarc)
self._set('soiltype', sitemodel.reference_soiltype)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this line and the test should become green again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But then how can we define a reference soiltype for all the sites in a region?

Copy link
Contributor

@micheles micheles Apr 9, 2021

Choose a reason for hiding this comment

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

Just write a site model with soiltype constant for all sites. If you look at the PR that I mentioned before (https://github.com/gem/oq-engine/pull/6672/files) the "bas" term is introduced only as a local site parameter. Not introducing reference_soiltype not only makes your life easier, it also avoids building a site collection larger than needed for all models not using Idini2017, i.e. all model in existence before this PR ;-)
It was a mistake to introduce the siteclass as a global parameter, I should remove that one too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, you are totally right! let me remove the line update

@micheles
Copy link
Contributor

micheles commented Apr 9, 2021

You forgot to commit case_63/expected/hcurve-mean.csv

@pheresi
Copy link
Contributor Author

pheresi commented Apr 9, 2021

Yep, was a mistake with the file names... updating! :)

@pheresi
Copy link
Contributor Author

pheresi commented Apr 9, 2021

Umm... Im not sure why the classical_test failed in my case_63... apparently, the number of lines in the hazard curve files are different

@micheles
Copy link
Contributor

micheles commented Apr 9, 2021

It looks looks like a wrong newline ending. You must remove a ^M character:

 @@ -1,3 +1,3 @@
-#,,,,,,"generated_by='OpenQuake engine 3.12.0', start_date='2021-04-07T11:23:52', checksum=2265841407, kind='mean', investigation_time=50.0, imt='PGA'"
-lon,lat,depth,poe-0.0100000,poe-0.1000000,poe-0.2000000,poe-0.5000000
-172.63000,-43.53000,0.00000,5.934701E-03,5.458004E-03,3.789143E-03,9.009379E-04^M
+#,,,,,,"generated_by='OpenQuake engine 3.12.0-gitd11f73014f', start_date='2021-04-09T06:16:57', checksum=2265841407, kind='mean', investigation_time=50.0, imt='PGA'"
+lon,lat,depth,poe-0.0100000,poe-0.1000000,poe-0.2000000,poe-0.5000000
+172.63000,-43.53000,0.00000,5.934701E-03,5.458004E-03,3.789143E-03,9.009379E-04

And now there are conflicts again, sorry ;-)

@pheresi
Copy link
Contributor Author

pheresi commented Apr 9, 2021

Got it! Updating :)

@pheresi
Copy link
Contributor Author

pheresi commented Apr 9, 2021

Finally! :)

Michele, thanks for your help, and sorry for the spam!

Copy link
Member

@mmpagani mmpagani left a comment

Choose a reason for hiding this comment

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

lgtm

@micheles micheles merged commit e853d10 into gem:master Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants