Ingenjorsarbete-For-Klimatet / ifk-smhi

SMHI climate data client.
https://ingenjorsarbeteforklimatet.se/ifk-smhi/
MIT License
9 stars 1 forks source link

'Datum' is not returned for parameter no 2 #91

Closed docNord closed 10 months ago

docNord commented 10 months ago

It seems MetObs is having trouble parsing data returned for parameter 2 (and possibly other?). We should explore why and adapt the code to allow reading all signals.

mgcth commented 10 months ago

For parameter 2, these columns are returned

Index(['Datum Tid (UTC)', 'Till Datum Tid (UTC)', 'Representativt dygn'], dtype='object')

For parameter 1, API returns these columns

Index(['Datum', 'Tid (UTC)', 'Lufttemperatur'], dtype='object')

We should have tests for all parameter types.

mgcth commented 10 months ago

We could add a test for each parameter type

https://github.com/Ingenjorsarbete-For-Klimatet/ifk-smhi/blob/f6bbae6e1758c75644eb41ae150ba3bfc6cbcc7a/tests/integration/test_integration_metobs.py#L171

And really, we should probably test the other APIs for different parameters (or throw an exception if we haven't tested it). Something you want to do @docNord? Adding tests shoudl be easy and just update the code as needed at

https://github.com/Ingenjorsarbete-For-Klimatet/ifk-smhi/blob/f6bbae6e1758c75644eb41ae150ba3bfc6cbcc7a/src/smhi/metobs.py#L595