Comments (14)
Ah, this might be caused by the fact that the package xarray
introduced the string interface only starting from version 0.13. Okay, this means you have to upgrade xarray to 0.13 at least: conda install xarray=0.13
.
@emanuel-schmid Can we update the xarray version from 0.12.1 to 0.13 in the conda requirements?
from climada_python.
Ah, this might be caused by the fact that the package
xarray
introduced the string interface only starting from version 0.13. Okay, this means you have to upgrade xarray to 0.13 at least:conda install xarray=0.13
.@emanuel-schmid Can we update the xarray version from 0.12.1 to 0.13 in the conda requirements?
Yes, I will at least try.
from climada_python.
I got it running now. A simple restart of all programms was enough. Sorry to have bothered you with these basic problems. I'll close the issue with this.
from climada_python.
I presume you're on the development branch; it's changed quite a bit from master. Either you could try using master if you don't depend on develop, or you could check the results in tc_tracks.py
from line 210 onward. Simply read the netcdf in a notebook and play around with it. sid
is the storm ID, maybe it doesn't get set correctly.
from climada_python.
Your presumption is right; I am using develop. Unfortunately; I depend on it. But I'll just sit back and relax because I don't trust myself fixing this bug.
from climada_python.
I'm afraid, I have no idea what might have caused your problem. I can't reproduce it with any of the last few versions of the develop branch. Please test again with the latest checkout from develop. If the problem persists, please also post the value of the basin
variable and the commit hash of your HEAD.
from climada_python.
The problem persists. Maybe my git rebase action before pulling develop caused the problem.
commit hash of my HEAD:
b282880
basin variable: 'NA'
tracks_IB = TCTracks()
tracks_IB.read_ibtracs_netcdf(basin='NA')
from climada_python.
Maybe I can latch on regarding the dependencies: since conda tries to resolve it all in one go, I would have suggested trying an all-out upgrade. I think we can safely rely on the tests in that scenario. The last full upgrade seems to be from sometime in mid-2019, based on the pinned versions.
from climada_python.
I presume you're on the development branch; it's changed quite a bit from master. Either you could try using master if you don't depend on develop, or you could check the results in
tc_tracks.py
from line 210 onward. Simply read the netcdf in a notebook and play around with it.sid
is the storm ID, maybe it doesn't get set correctly.
Please do not use master, just because develop fails. In the end develop will become master and if you cannot solve the problem on develop the problem is not solved.
from climada_python.
Please do not use master, just because develop fails. In the end develop will become master and if you cannot solve the problem on develop the problem is not solved.
Sure, I didn't mean "fix the bug in master" - I merely meant that the bug was introduced by develop. If Simona could have written her code without depending on develop, she could simply have continued working...
About the dependency upgrade: does it warrant a separate issue to keep track of it? Is it desirable in the first place?
from climada_python.
Definitely desirable but not quickly done. The dependency carousel in CLIMADA is quite a beast and because of the cross-dependencies timing is crucial. There is no point in making this an issue for it will never be solved.
The general task to update them on a regular base is part of my maintenance service.
When a particular version causes problems, this needs its own issue.
from climada_python.
Ah, this might be caused by the fact that the package
xarray
introduced the string interface only starting from version 0.13. Okay, this means you have to upgrade xarray to 0.13 at least:conda install xarray=0.13
.@emanuel-schmid Can we update the xarray version from 0.12.1 to 0.13 in the conda requirements?
I updated xarray according to Thomas' suggestion and also updated netcdf4. Now, I still seem to have a problem at another end:
tracks_dict = dict()
tracks_IBTrACS = init_tc_tracks_IBTrACS('NA')
Traceback (most recent call last):
File "<ipython-input-17-ea06de5baa8e>", line 2, in <module>
tracks_IBTrACS = init_tc_tracks_IBTrACS('NA')
File "/Users/simonameiler/Documents/WCR/Scripts/TC_IB_K_G_his_1.py", line 167, in init_tc_tracks_IBTrACS
tracks_IB.read_ibtracs_netcdf(year_range=(1980, 2017), basin=basin, correct_pres=False)
File "/Users/simonameiler/Documents/WCR/CLIMADA_develop/climada_python/climada/hazard/tc_tracks.py", line 226, in read_ibtracs_netcdf
ds = xr.open_dataset(fn_nc)
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/site-packages/xarray/backends/api.py", line 499, in open_dataset
filename_or_obj, group=group, lock=lock, **backend_kwargs
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/site-packages/xarray/backends/netCDF4_.py", line 389, in open
pop_to(attributes, encoding, "least_significant_digit")
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/site-packages/xarray/backends/netCDF4_.py", line 335, in __init__
if format is None:
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/site-packages/xarray/backends/netCDF4_.py", line 398, in ds
dsvars = FrozenDict(
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/site-packages/xarray/backends/netCDF4_.py", line 392, in _acquire
encoding["original_shape"] = var.shape
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/site-packages/xarray/backends/file_manager.py", line 183, in acquire_context
@contextlib.contextmanager
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/site-packages/xarray/backends/file_manager.py", line 195, in _acquire_with_cache_info
"""Acquire a file, returning the file and whether it was cached."""
File "/Users/simonameiler/opt/anaconda3/envs/climada_env/lib/python3.7/site-packages/xarray/backends/lru_cache.py", line 52, in __getitem__
with self._lock:
TypeError: descriptor '_lock' for 'LRUCache' objects doesn't apply to 'LRUCache' object
from climada_python.
I'm running my code with netcdf4 version 1.4.2. That's the one in the CLIMADA requirements file. Is there any reason why you decided to upgrade netcdf4?
from climada_python.
I upgraded it to 1.4.2 as well. The reason why I chose to update it was that I ran into a bottleneck error that in my understanding was associated to my previous version of netcdf4. But I'm happy to go hunt down the error on my side.
from climada_python.
Related Issues (20)
- `Hazard.from_xarray_raster` requires that "event" dimension can be interpreted as datetime HOT 4
- `Impact.select()` reset_frequency option HOT 4
- Persistent Wind Intensity Patterns in Historical Typhoon Tracks Beyond 180 Degrees Longitude HOT 9
- Syria LitPop returns Value NaN for all values HOT 2
- difficulties with installation HOT 9
- WorldBank tests fail HOT 1
- Fiona Error on fresh installs HOT 8
- haz.select() doesn't work with empty haz.fraction matrix HOT 11
- PR #833 breaks test in climada_petals HOT 1
- installation fails - channel settings HOT 3
- Flood data for Colombia, Nigeria, Sudan and Venezuela has an array of float 1.0 for .date attribute HOT 9
- xarray 2024.2 breaks unit test HOT 2
- Create a function to store the local exceedence intensity maps as netcdf file
- Data freshness HOT 2
- coordinates.lon_bounds can give a range larger than 360 degrees HOT 1
- util.coordinates.get_land_geometry can't handle the antimeridian unless the extent is (-180, 180) HOT 3
- upgrading dask to 2024.3 leads to tests failing HOT 4
- Links in tutorials within the doc do not work (the ones on the right side navigation bar are ok) HOT 2
- Shapely runtime warnings in newer climada_env builds HOT 2
- Plotting hazards with inapt crs HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from climada_python.