You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Model class attempts to read an empty working directory it throws an IndexError which does not point to the actual issue that their are no model files. See code block example below. Just need to add in a check that the path is not empty before it attempts to read files.
In [11]: lsIn [12]: fromseisflows.tools.modelimportModelIn [13]: m=Model(fmt=".bin", flavor="3D")
---------------------------------------------------------------------------IndexErrorTraceback (mostrecentcalllast)
CellIn[13], line1---->1m=Model(fmt=".bin", flavor="3D")
File~/Repos/seisflows/seisflows/tools/model.py:126, inModel.__init__(self, path, fmt, parameters, regions, flavor)
122self.flavor=self._guess_specfem_flavor()
124# Gather internal representation of the model for manipulation125self._nproc, self.available_parameters= \
-->126self._get_nproc_parameters()
127self.model=self.read(parameters=parameters)
129# Coordinates are only useful for SPECFEM2D modelsFile~/Repos/seisflows/seisflows/tools/model.py:664, inModel._get_nproc_parameters(self)
658avail_par=list(set(avail_par).intersection(
659set(self.acceptable_parameters)
660 ))
661# Count the number of files for matching parameters only (do once)662# Globe version requires the region number in the wild card663nproc=len(glob(os.path.join(
-->664self.path, self.fnfmt(val=avail_par[0], ext=self.fmt)))
665 )
666elifself.fmt==".dat":
667# e.g., 'proc000000_rho_vp_vs'668_, *avail_par=fids[0].split("_")
IndexError: listindexoutofrange
The text was updated successfully, but these errors were encountered:
When
Model
class attempts to read an empty working directory it throws an IndexError which does not point to the actual issue that their are no model files. See code block example below. Just need to add in a check that the path is not empty before it attempts to read files.The text was updated successfully, but these errors were encountered: