1 of type ims could not be opened Error #1362
Unanswered
ENVEXPOSURE
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey All - I'm working with the Neversink notebooks (see https://ngwa.onlinelibrary.wiley.com/doi/epdf/10.1111/gwat.13129), which was developed by Fienen et al., 2022. However, I ran into a hiccup with notebook 4 (inspect parent model) dealing with opening the IMS file. Oddly, the code works on the first loop, but an error in the second loop with the ims file. In this case the second loop is model 0104_0106_0107_0109_MF6_SS_Unconfined_250). If I change the order of models to loop through, the first loop works, but the second loop does not.
See the attached notebook (HTML format) detailing the code and error. Below is an image of the files in the first two models the code loops through.
It is not apparent to me what the issue is. I would appreciate any help.
-Sarken
0.4_inspect_parent_models.zip
OUTPUT & ERROR SUMMARY:
working on model: 0101_0102_0103_0105_MF6_SS_Unconfined_250
loading simulation...
loading simulation name file...
loading tdis package...
loading model gwf6...
loading package dis...
loading package chd...
loading package ghb...
loading package drn...
loading package ic...
WARNING: Block "options" is not a valid block name for file type ic.
loading package npf...
loading package oc...
loading package rch...
loading ims package gwf0...
setting model grid
Successfully Obtained and Set Grid information
Exporting other model data such as grid size and hydraulc heads
dis package...
wrote ../parent_model/mfexport_outfiles/0101_0102_0103_0105_MF6_SS_Unconfined_250\dis\rasters\thickness_lay0.tif
top:
wrote ..\parent_model\mfexport_outfiles\0101_0102_0103_0105_MF6_SS_Unconfined_250\dis\rasters\top.tif
botm:
wrote ..\parent_model\mfexport_outfiles\0101_0102_0103_0105_MF6_SS_Unconfined_250\dis\rasters\botm_lay0.tif
idomain:
wrote ..\parent_model\mfexport_outfiles\0101_0102_0103_0105_MF6_SS_Unconfined_250\dis\rasters\idomain_lay0.tif
Successfully exported model discretization information
File saved here: ../parent_model/mfexport_outfiles/0101_0102_0103_0105_MF6_SS_Unconfined_250\dis
Exporting other model data such as grid size and hydraulc heads
Exporting heads...
file: ../source_data/Shapefiles/NGWM\outputs.0101_0102_0103_0105_MF6_SS_Unconfined_250\0101_0102_0103_0105_MF6_SS_Unconfined_250.hds
stress period 0, timestep 0
wrote ../parent_model/mfexport_outfiles/0101_0102_0103_0105_MF6_SS_Unconfined_250\hds\rasters/wt_per0_stp0.tif
C:\Users\Sarken\anaconda3\envs\neversink\lib\site-packages\pandas\core\dtypes\cast.py:112: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
values = construct_1d_object_array_from_listlike(values)
writing ../parent_model/mfexport_outfiles/0101_0102_0103_0105_MF6_SS_Unconfined_250\hds\shps/wt_ctr_per0_stp0.shp... Done
Model export complete
working on model: 0104_0106_0107_0109_MF6_SS_Unconfined_250
loading simulation...
loading simulation name file...
loading tdis package...
loading model gwf6...
loading package dis...
loading package chd...
loading package ghb...
loading package drn...
loading package ic...
WARNING: Block "options" is not a valid block name for file type ic.
loading package npf...
loading package oc...
loading package rch...
loading ims package gwf0...
loading ims package ims_0...
FileNotFoundError Traceback (most recent call last)
File ~\Python\PROJECTS\FloPy\Tutorials\neversink_workflow-main\neversink_workflow-main\notebooks_preprocessing_complete../python_packages_static\flopy\mf6\mfpackage.py:1947, in MFPackage.load(self, strict)
1946 try:
-> 1947 fd_input_file = open(self.get_file_path(), "r")
1948 except OSError as e:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Sarken\Python\PROJECTS\FloPy\Tutorials\neversink_workflow-main\neversink_workflow-main\notebooks_preprocessing_complete\..\source_data\Shapefiles\NGWM\0104_0106_0107_0109_MF6_SS_Unconfined_250\1'
During handling of the above exception, another exception occurred:
MFDataException Traceback (most recent call last)
Input In [12], in
8 # setup model work space and load model with flopy located in parent directory
9 model_ws = os.path.join(parent_dir, model) #each model work space should have a nam file, and other important info.
---> 10 sim = fp.mf6.MFSimulation.load(simname, 'mf6', sim_ws=model_ws)
11 m = sim.get_model() # tool obtains model information from files in parent directory
13 # read model upper left coords and proj4 string from 'usgs.model.reference' file
File ~\Python\PROJECTS\FloPy\Tutorials\neversink_workflow-main\neversink_workflow-main\notebooks_preprocessing_complete../python_packages_static\flopy\mf6\modflow\mfsimulation.py:881, in MFSimulation.load(cls, sim_name, version, exe_name, sim_ws, strict, verbosity_level, load_only, verify_data, write_headers)
876 if verbosity_level.value >= VerbosityLevel.normal.value:
877 print(
878 " loading ims package {}.."
879 ".".format(ims_file._get_pname())
880 )
--> 881 ims_file.load(strict)
883 instance.simulation_data.mfpath.set_last_accessed_path()
884 if verify_data:
File ~\Python\PROJECTS\FloPy\Tutorials\neversink_workflow-main\neversink_workflow-main\notebooks_preprocessing_complete../python_packages_static\flopy\mf6\mfpackage.py:1954, in MFPackage.load(self, strict)
1950 message = "File {} of type {} could not be opened" ".".format(
1951 self.get_file_path(), self.package_type
1952 )
1953 type_, value_, traceback_ = sys.exc_info()
-> 1954 raise MFDataException(
1955 self.model_name,
1956 self.package_name,
1957 self.path,
1958 "loading package file",
1959 None,
1960 inspect.stack()[0][3],
1961 type_,
1962 value_,
1963 traceback_,
1964 message,
1965 self._simulation_data.debug,
1966 )
1968 try:
1969 self._load_blocks(fd_input_file, strict)
MFDataException: An error occurred in package "ims_0". The error occurred while loading package file in the "load" method.
Additional Information:
(1) File ........\neversink_workflow-main\neversink_workflow-main\notebooks_preprocessing_complete..\source_data\Shapefiles\NGWM\0104_0106_0107_0109_MF6_SS_Unconfined_250\1 of type ims could not be opened.
Beta Was this translation helpful? Give feedback.
All reactions