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

Add band_names property to STRDSInfoModel #243

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

jonas-eberle
Copy link
Contributor

I have tested the actinia with recent grass gis changes (band names) and I got an error, when requesting t.info from actinia:

Actinia request for ECAD example dataset:
/api/v1/locations/ECAD/mapsets/PERMANENT/strds/precipitation_1950_2013_yearly_mm

Error:

message: "The model "STRDSInfoModel" does not have an attribute "band_names"",
traceback: [
" File "/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py", line 1747, in run self._execute() ",
" File "/usr/lib/python3.8/site-packages/actinia_core/rest/strds_management.py", line 410, in _execute self.module_results = STRDSInfoModel(**strds) ",
" File "/usr/lib/python3.8/site-packages/flask_restful_swagger_2/__init__.py", line 336, in __init__ raise ValueError( "
],
type: "<class 'ValueError'>"
},

Thus, I have added the property band_names to the STRDSInfoModel schema. Do you have a sample dataset with band names available to check the correct behavior?

With the changes the above request works fine with "None" as band_names value.

Best
Jonas

@mmacata
Copy link
Member

mmacata commented Sep 21, 2021

Cool, thanks a lot for this @jonas-eberle !
@metzm do you have a sample dataset available, maybe from your implementation in GRASS GIS?
@anikaweinmann do you see any problems with adjusting the model, especially for backward compatibility with GRASS GIS 7.8?

@metzm
Copy link
Contributor

metzm commented Sep 21, 2021

Cool, thanks a lot for this @jonas-eberle !
@metzm do you have a sample dataset available, maybe from your implementation in GRASS GIS?

Any STRDS with entries in the column band_reference will do. The list of band names is generated on the fly and does not require any updating of STRDS's or the TGIS db.

@anikaweinmann do you see any problems with adjusting the model, especially for backward compatibility with GRASS GIS 7.8?

The band_names output of t.info is new to GRASS 8 (main) and will not be backported. Setting in actinia band_names by default to None should work with G78.

@anikaweinmann
Copy link
Member

I also see no problem with adding the band_names with default value None.

@mmacata
Copy link
Member

mmacata commented Sep 21, 2021

Very well, then I will merge this.

@mmacata mmacata merged commit 6a87d20 into actinia-org:main Sep 21, 2021
@metzm
Copy link
Contributor

metzm commented Sep 21, 2021

Very well, then I will merge this.

Too late: I wanted to suggest to move band_names just behind number_of_bands in the STRDSInfoModel and remove band_reference from it (band_reference applies only to raster maps in a STRDS, not the STRDS itself).

@mmacata mmacata added this to the 1.2.1 milestone Nov 9, 2022
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

Successfully merging this pull request may close these issues.

4 participants