Coder Social home page Coder Social logo

Comments (14)

tovogt avatar tovogt commented on July 28, 2024 1

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.

emanuel-schmid avatar emanuel-schmid commented on July 28, 2024 1

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.

simonameiler avatar simonameiler commented on July 28, 2024 1

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.

mmyrte avatar mmyrte commented on July 28, 2024

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.

simonameiler avatar simonameiler commented on July 28, 2024

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.

tovogt avatar tovogt commented on July 28, 2024

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.

simonameiler avatar simonameiler commented on July 28, 2024

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.

mmyrte avatar mmyrte commented on July 28, 2024

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.

emanuel-schmid avatar emanuel-schmid commented on July 28, 2024

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.

mmyrte avatar mmyrte commented on July 28, 2024

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.

emanuel-schmid avatar emanuel-schmid commented on July 28, 2024

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.

simonameiler avatar simonameiler commented on July 28, 2024

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.

tovogt avatar tovogt commented on July 28, 2024

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.

simonameiler avatar simonameiler commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.