Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error running test case PyChemiss #8

Open
fipoucat opened this issue Sep 11, 2023 · 1 comment
Open

error running test case PyChemiss #8

fipoucat opened this issue Sep 11, 2023 · 1 comment

Comments

@fipoucat
Copy link

I am installing the package but while testing it I am having error, and what is causing this?

python3 src/pychemiss.py pychemiss.yml
----------INPUT TOTAL EMISSIONS----------
Total CO emission = 3.34 kTn
Total NO emission = 1.11 kTn
Total NO2 emission = 0.12 kTn
----------AFTER REGRIDDING TOTAL EMISSION----------
Total CO emission after regridding = 3.58 kTn
Total NO emission after regridding = 1.19 kTn
Total NO3 emission after regridding = 0.13 kTn
Traceback (most recent call last):
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/file_manager.py", line 211, in _acquire_with_cache_info
file = self._cache[self._key]
~~~~~~~~~~~^^^^^^^^^^^
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/lru_cache.py", line 56, in getitem
value = self._cache[key]
~~~~~~~~~~~^^^^^
KeyError: [<function _open_scipy_netcdf at 0x7f20c4426ca0>, ('/media/sarr/DATA/work/PyChEmiss/results/wrfchemi_d02_2018-06-21_00:00:00',), 'a', (('mmap', None), ('version', 2)), '762d32c4-f09c-4753-bfb4-60214dcbef41']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/media/sarr/DATA/work/PyChEmiss/src/pychemiss.py", line 410, in
write_wrfchemi(wrfchemi_nc, wrfinput_ds, date_inp)
File "/media/sarr/DATA/work/PyChEmiss/src/pychemiss.py", line 346, in write_wrfchemi
write_netcdf(wrfchemi, output_name)
File "/media/sarr/DATA/work/PyChEmiss/src/pychemiss.py", line 310, in write_netcdf
wrfchemi.to_netcdf(path + file_name,
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/core/dataset.py", line 2252, in to_netcdf
return to_netcdf( # type: ignore # mypy cannot resolve the overloads:(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/api.py", line 1246, in to_netcdf
dump_to_store(
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/api.py", line 1293, in dump_to_store
store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/common.py", line 354, in store
self.set_attributes(attributes)
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/common.py", line 371, in set_attributes
self.set_attribute(k, v)
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/scipy_.py", line 210, in set_attribute
setattr(self.ds, key, value)
^^^^^^^
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/scipy_.py", line 170, in ds
return self._manager.acquire()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/file_manager.py", line 193, in acquire
file, _ = self._acquire_with_cache_info(needs_lock)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/file_manager.py", line 217, in _acquire_with_cache_info
file = self._opener(*self.args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/xarray/backends/scipy
.py", line 109, in _open_scipy_netcdf
return scipy.io.netcdf_file(filename, mode=mode, mmap=mmap, version=version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarr/anaconda3/envs/PyChEmiss/lib/python3.11/site-packages/scipy/io/_netcdf.py", line 246, in init
self.fp = open(self.filename, '%sb' % omode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: '/media/sarr/DATA/work/PyChEmiss/results/wrfchemi_d02_2018-06-21_00:00:00'

@quishqa
Copy link
Owner

quishqa commented Jan 24, 2025

Sorry @fipoucat for the late reply, did you managed to solve the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants