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 in tensorsat.py for rioxarray version > 0.17.0 #4

Open
s6hebern opened this issue Jan 30, 2025 · 0 comments
Open

Error in tensorsat.py for rioxarray version > 0.17.0 #4

s6hebern opened this issue Jan 30, 2025 · 0 comments

Comments

@s6hebern
Copy link

Dear developers,

I'm running cloudsen12 version 0.0.7 and updated my environment to rioxarray version 0.18.2 (from 0.17.0).
When calling

jp2files = cloudsen12.MaskayDict(
    path=self._input_path,
    pattern=r'^(?!.*QI_DATA).*\.jp2$',
    full_names=True,
    recursive=True,
    sensor='Sentinel-2'
)
tensor = cloudsen12.TensorSat(**jp2files.to_dict(), cache=True, align=False)

I get this error:

File "C:\Python310\lib\site-packages\maskay\tensorsat.py", line 40, in __init__
    self.Aerosol: Union[str, np.ndarray, xr.DataArray] = Aerosol
  File "C:\Python310\lib\site-packages\maskay\tensorsat.py", line 127, in Aerosol
    self._Aerosol = self.to_xarray(value)
  File "C:\Python310\lib\site-packages\maskay\tensorsat.py", line 100, in to_xarray
    with rioxarray.open_rasterio(object, "r") as src:
TypeError: open_rasterio() takes 1 positional argument but 2 were given

This can be resolved by downgrading rioxarray back to version 0.17.0. Would it be possible to either update the dependencies, or update the code to correctly call rioxarray.open_rasterio?

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

1 participant