Skip to content

Commit c9e5035

Browse files
committed
Merge remote-tracking branch 'origin/master' into endpoints
2 parents bbc6615 + 85f1cc8 commit c9e5035

File tree

7 files changed

+30
-24
lines changed

7 files changed

+30
-24
lines changed

doc/getting-started/installation-instructions/development.rst

+12-5
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,17 @@ convenience you can also add it as an ``alias`` in your ``~/.bashrc``
113113
Multiple installations
114114
----------------------
115115

116-
If any other installation of the Engine exists on the same machine, like
117-
a system-wide installation made with packages, you must change the
116+
If any other installation of the Engine exists on the same machine - like
117+
a system-wide installation made with packages - you should change the
118118
DbServer port from the default one (1908) to any other unused port.
119-
Using a DbServer started from a different codebase (which may be
120-
out-of-sync) could lead to unexpected behaviours and errors. To change
121-
the DbServer port ``oq-engine/openquake/engine/openquake.cfg`` must be
119+
120+
If the two installations have the same structure of the database and
121+
the codebase is not that different (which is the normal case) everything will
122+
work even without changing the DbServer port.
123+
124+
However, in general using a DbServer started from a different installation
125+
could lead to unexpected behaviours and errors. To change
126+
the DbServer port the file ``openquake.cfg`` must be
122127
updated:
123128

124129
::
@@ -129,6 +134,8 @@ updated:
129134
authkey = changeme | authkey = changeme
130135
## cut ## | ## cut ##
131136

137+
The file should be put in your virtual environment.
138+
132139
Running the tests
133140
-----------------
134141

doc/release-notes/whats-new-2.4.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ the amount of dependencies needed by `python-oq-engine` when installed on
479479
a single node. Specific configurations for _master_ and _workers_ nodes
480480
are provided by dedicated packages.
481481
This setup will be ported to Ubuntu packages too in the next release.
482-
See the [documentation](cluster) for further information.
482+
See the documentation for further information.
483483

484484
Deprecations
485485
------------------------------

doc/release-notes/whats-new-3.3.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ filesystem and to configure the `shared_dir` parameter in the file
665665
`openquake.cfg`. Without that, classical calculations will fail during
666666
the calculation of statistics and event based calculations will fail
667667
during the computations of GMFs, with some kind of "File not found"
668-
error. The documentation is [here](cluster).
668+
error.
669669

670670
5. Docker support has been improved and now works properly on a
671671
multi-node, multi-host deployment. We now also have a mechanism to

openquake/calculators/classical.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,6 @@ def _create_hcurves_maps(self):
738738
oq = self.oqparam
739739
N = len(self.sitecol)
740740
R = len(self.datastore['weights'])
741-
if oq.individual_rlzs is None: # not specified in the job.ini
742-
individual_rlzs = (N == 1) * (R > 1)
743-
else:
744-
individual_rlzs = oq.individual_rlzs
745741
hstats = oq.hazard_stats()
746742
# initialize datasets
747743
P = len(oq.poes)
@@ -753,7 +749,7 @@ def _create_hcurves_maps(self):
753749
L = oq.imtls.size
754750
L1 = self.L1 = L // M
755751
S = len(hstats)
756-
if R == 1 or individual_rlzs:
752+
if R == 1 or oq.individual_rlzs:
757753
self.datastore.create_dset('hcurves-rlzs', F32, (N, R, M, L1))
758754
self.datastore.set_shape_descr(
759755
'hcurves-rlzs', site_id=N, rlz_id=R, imt=imts, lvl=L1)
@@ -772,7 +768,7 @@ def _create_hcurves_maps(self):
772768
self.datastore.set_shape_descr(
773769
'hmaps-stats', site_id=N, stat=list(hstats),
774770
imt=list(oq.imtls), poe=oq.poes)
775-
return N, S, M, P, L1, individual_rlzs
771+
return N, S, M, P, L1
776772

777773
# called by execute before post_execute
778774
def build_curves_maps(self):
@@ -781,15 +777,15 @@ def build_curves_maps(self):
781777
"""
782778
oq = self.oqparam
783779
hstats = oq.hazard_stats()
784-
N, S, M, P, L1, individual = self._create_hcurves_maps()
780+
N, S, M, P, L1 = self._create_hcurves_maps()
785781
if '_rates' in set(self.datastore) or not self.datastore.parent:
786782
dstore = self.datastore
787783
else:
788784
dstore = self.datastore.parent
789785
wget = self.full_lt.wget
790-
allargs = [(getter, wget, hstats, individual, oq.max_sites_disagg,
791-
self.amplifier) for getter in getters.map_getters(
792-
dstore, self.full_lt)]
786+
allargs = [(getter, wget, hstats, oq.individual_rlzs,
787+
oq.max_sites_disagg, self.amplifier)
788+
for getter in getters.map_getters(dstore, self.full_lt)]
793789
if not config.directory.custom_tmp and not allargs: # case_60
794790
logging.warning('No rates were generated')
795791
return

openquake/calculators/postproc/median_spectrum.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def check_rup_unique(spec_disagg):
100100

101101

102102
# NB: we are ignoring IMT-dependent weight
103-
def compute_median_spectrum(cmaker, context, uhs, monitor=performance.Monitor()):
103+
def compute_median_spectrum(
104+
cmaker, context, uhs, monitor=performance.Monitor()):
104105
"""
105106
For a given group, computes the median hazard spectrum using a weighted
106107
mean based on the poes.

openquake/commonlib/readinput.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def update(params, items, base_path):
208208
for key, value in items:
209209
if key in ('hazard_curves_csv', 'hazard_curves_file',
210210
'gmfs_csv', 'gmfs_file',
211-
'site_model_csv', 'site_model_file',
211+
'site_model_csv', 'site_model_file', 'source_model_file',
212212
'exposure_csv', 'exposure_file'):
213213
input_type, fnames = _normalize(key, value.split(), base_path)
214214
params['inputs'][input_type] = fnames
@@ -1184,8 +1184,8 @@ def get_station_data(oqparam, sitecol, duplicates_strategy='error'):
11841184
logging.error('Conditioned scenarios are not meant to be run '
11851185
' on a cluster')
11861186
# Read the station data and associate the site ID from longitude, latitude
1187-
df = read_df(oqparam.inputs['station_data'], 'LONGITUDE', 'LATITUDE', 'STATION_ID',
1188-
duplicates_strategy=duplicates_strategy)
1187+
df = read_df(oqparam.inputs['station_data'], 'LONGITUDE', 'LATITUDE',
1188+
'STATION_ID', duplicates_strategy=duplicates_strategy)
11891189
lons = df['LONGITUDE'].to_numpy()
11901190
lats = df['LATITUDE'].to_numpy()
11911191
nsites = len(sitecol.complete)
@@ -1300,7 +1300,8 @@ def impact_tmap(oqparam, taxidx):
13001300
for key in exp['tmap']:
13011301
# tmap has fields conversion, taxonomy, weight
13021302
df = exp.read_df('tmap/' + key)
1303-
for taxo, risk_id, weight in zip(df.taxonomy, df.conversion, df.weight):
1303+
for taxo, risk_id, weight in zip(
1304+
df.taxonomy, df.conversion, df.weight):
13041305
if taxo in taxidx:
13051306
acc['country'].append(key)
13061307
acc['peril'].append('groundshaking')

openquake/hazardlib/contexts.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ class ContextMaker(object):
554554
deltagetter = None
555555
fewsites = False
556556
tom = None
557+
cluster = None # set in PmapMaker
557558

558559
def __init__(self, trt, gsims, oq, monitor=Monitor(), extraparams=()):
559560
self.trt = trt
@@ -1191,9 +1192,9 @@ def get_pmap(self, ctxs, tom=None, rup_mutex={}):
11911192
rup_indep = not rup_mutex
11921193
sids = numpy.unique(ctxs[0].sids)
11931194
pmap = MapArray(sids, size(self.imtls), len(self.gsims)).fill(rup_indep)
1194-
ptom = PoissonTOM(self.investigation_time)
1195+
self.tom = tom or PoissonTOM(self.investigation_time)
11951196
for ctx in ctxs:
1196-
self.update(pmap, ctx, tom or ptom, rup_mutex)
1197+
self.update(pmap, ctx, rup_mutex)
11971198
return ~pmap if rup_indep else pmap
11981199

11991200
def ratesNLG(self, srcgroup, sitecol):

0 commit comments

Comments
 (0)