Coder Social home page Coder Social logo

Comments (3)

micheles avatar micheles commented on July 18, 2024

Seems to be the intended behavior, indeed the docstring of the class says

        :raises KeyError:
            If ``imt`` is not available in the table and no interpolation
            can be done.

from oq-engine.

g-weatherill avatar g-weatherill commented on July 18, 2024

I don't think this was the intended behaviour of the GMPE, but perhaps the issue raised didn't provide a full enough explanation.

AkkarBommer2010SWISS01, AkkarBommer2010SWISS04 and AkkarBommer2010SWISS08 all inherit from AkkarBommer2010, which is defined as supported for PGA, SA and PGV. The sub-classes don't change the DEFINED_FOR_INTENSITY_MEASURE_TYPES attribute, so they are also indicted as being supported for PGA, SA and PGV. However, the Swiss subclasses use the rock adjustment factors here: https://github.com/gem/oq-engine/blob/master/openquake/hazardlib/gsim/akkar_bommer_2010_swiss_coeffs.py, which are only defined for PGA and SA, but not for PGV. The outcome of this is that OQ will pass the validation checks if you try to run calculations with them using PGV but then later crash out with theKeyError that occurs when it tries to get the PGV coefficients from these tables.

The fix is just to update DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, SA} in the subclasses.

from oq-engine.

micheles avatar micheles commented on July 18, 2024

Ah, thanks Graeme, now it is clear.

from oq-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.