Skip to content

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

@s6hebern

Description

@s6hebern

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions