GEMScienceTools / gmpe-smtk

Python and OpenQuake-based Toolkit for Analysis of Strong Motions and Interpretation of GMPEs
GNU Affero General Public License v3.0
43 stars 33 forks source link

Fixed the tests for boolean fields in the site collection #121

Closed micheles closed 3 years ago

micheles commented 3 years ago

Fixes the error in https://github.com/GEMScienceTools/gmpe-smtk/runs/1899995211?check_suite_focus=true:

    def get_phi(self, C, mag, sites, nl0):
        """
        Returns the within-event variability described in equation 13, line 3
        """
        phi = C["sig3"] * np.ones(sites.vs30.shape)
>       phi[sites.vs30measured] = 0.7
E       IndexError: arrays used as indices must be of integer (or boolean) type

Plus some PEP8 fixes.