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

Unable to create STAC items #31

Open
varisht-tathya opened this issue Jan 23, 2024 · 5 comments · May be fixed by #34
Open

Unable to create STAC items #31

varisht-tathya opened this issue Jan 23, 2024 · 5 comments · May be fixed by #34
Labels
bug Something isn't working

Comments

@varisht-tathya
Copy link

Describe the bug
I am unable to create a STAC item of a S3 product. Product has been extracted from a Sen 3 product zip file. I get this error instead:

TypeError: FileExtensionUpdated() takes no arguments

To reproduce
Steps to reproduce the behavior:

path = "/home/varisht/S3_DIR/S3A_SL_1_RBT____20230126T040853_20230126T041153_20230127T131532_0179_094_375_2520_PS1_O_NT_004.SEN3"
item = stac.create_item(path, skip_nc=False)

# I get the following error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[74], line 1
----> 1 item = stac.create_item(path, skip_nc=False)

File ~/anaconda3/envs/pystac/lib/python3.12/site-packages/stactools/sentinel3/stac.py:84, in create_item(granule_href, skip_nc, read_href_modifier)
     82 item.add_asset(manifest_asset_key, manifest_asset)
     83 manifest_href = os.path.join(granule_href, MANIFEST_FILENAME)
---> 84 manifest_file = FileExtensionUpdated.ext(manifest_asset, add_if_missing=True)
     85 fill_manifest_file_properties(manifest_href, metalinks.manifest_text, manifest_file)
     87 # create band asset list

File ~/anaconda3/envs/pystac/lib/python3.12/site-packages/stactools/sentinel3/file_extension_updated.py:38, in FileExtensionUpdated.ext(cls, obj, add_if_missing)
     33 @classmethod
     34 def ext(
     35     cls, obj: pystac.Asset, add_if_missing: bool = False
     36 ) -> "FileExtensionUpdated":
     37     super().ext(obj, add_if_missing)
---> 38     return cls(obj)

TypeError: FileExtensionUpdated() takes no arguments

Expected behavior
I should get a STAC item
Screenshots and shell session dumps

Additional context

@varisht-tathya varisht-tathya added the bug Something isn't working label Jan 23, 2024
@sreimond-eodc
Copy link

I have the same issue. Is this package still being developed? Are there alternatives for Sentinel-3 data?

@lmizzoni
Copy link

lmizzoni commented May 16, 2024

Hello everyone!
It seems that using python version 3.10 or higher doesn't work.

Try using the python version 3.8, for me worked well.

@fabricebrito
Copy link

fabricebrito commented Jun 5, 2024

@lmizzoni can you pin pystac < 1.9.0 using python 3.10?
I guess this issue is linked to pystac commit stac-utils/pystac@d7a6712#diff-ead4b1abaa38d4af24f580bee0525e7ebdce83cce67cfbf26ef42646179f0fcc
and provide the outcome here?

@lmizzoni
Copy link

lmizzoni commented Jun 5, 2024

@lmizzoni can you pin pystac < 1.9.0 using python 3.10? I guess this issue is linked to pystac commit stac-utils/pystac@d7a6712#diff-ead4b1abaa38d4af24f580bee0525e7ebdce83cce67cfbf26ef42646179f0fcc and provide the outcome here?

I did some tests using pystac version < 1.9.0 and Python >= 3.10, and everything worked well. After running the command stac sentinel3 create-item <source> <destination>, I received the STAC item without errors.

However, switching to pystac version 1.9.0 or higher causes the error to reappear. Therefore, I agree that the error seems to be linked to that commit.

jonas-eberle added a commit to DLR-terrabyte/stactools-sentinel3 that referenced this issue Jun 12, 2024
@fbalaban
Copy link

Hey @jonas-eberle, do you want create a PR for that fix you've applied at the fork?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants