From b275b1b2629f564debcc55e174e30bfb712ea310 Mon Sep 17 00:00:00 2001 From: pavlis Date: Sat, 3 Feb 2024 22:30:13 +0000 Subject: [PATCH] :art: Format Python code with psf/black --- python/mspasspy/db/database.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/python/mspasspy/db/database.py b/python/mspasspy/db/database.py index 699fee7f1..97cd90b67 100644 --- a/python/mspasspy/db/database.py +++ b/python/mspasspy/db/database.py @@ -7391,28 +7391,27 @@ def _construct_ensemble( for path in bf_dict: this_mdl = bf_dict[path] if len(this_mdl) > 1: - # _group_by_path assures all compomnents of this_mdl - # have the same value of dir and file. Use an iteration to + # _group_by_path assures all compomnents of this_mdl + # have the same value of dir and file. Use an iteration to # assure dir and dfile are present in one of the components # TODO: this may have an issue if there are entries marked undefined # needs a controlled tests. - dir="UNDEFINED" + dir = "UNDEFINED" for md in this_mdl: - if md.is_defined('dir') and md.is_defined('dfile'): - dir = md['dir'] - dfile = md['dfile'] + if md.is_defined("dir") and md.is_defined("dfile"): + dir = md["dir"] + dfile = md["dfile"] break - if dir=="UNDEFINED": + if dir == "UNDEFINED": message = "Database.construct_ensemble: " message += "binary file reader section could not find values for dir and/or dfile" message += "This should not happen but was trapped to avoid mysterious errors" - raise MsPASSError(message,ErrorSeverity.Fatal) + raise MsPASSError(message, ErrorSeverity.Fatal) + + ens_tmp, abortions = self._load_ensemble_file( + this_mdl, object_type, dir, dfile + ) - ens_tmp, abortions = self._load_ensemble_file(this_mdl, - object_type, - dir, - dfile) - # the above guarantees ens_tmp has no dead dead for d in ens_tmp.member: ensemble.member.append(d)