Repository navigation
Conversation
|
@hadrilec @linogaliana @tfardet @RLesur do any of you guys see the point in covering MELODI's "référentiel" endpoint through It doesn't seem to be used in the R package and I have no usecase in my mind right now (that and the fact that the json returned seem overly complex to be used in a generic way)... |
|
Note: 2 tickets have been opened on INSEE's API portal.
|
|
Hi, I had started in the branch catalog to write a function retrieving the list of datasets available via melodi. On the long term, I think it makes sense, as I understand more INSEE datasets shall be available melodi. I understand that DoReMiFaSol already uses melodi: https://github.com/InseeFrLab/DoReMIFaSol |
|
Hi @hadrilec , I've already re-used your code for the catalog (which I also think is gonna be madatory). I was instead speaking of the "référentiel" endpoint and I haven't quite seen the point (yet ?). Right now, you got catalog (as already said), you got all available dimensions and values for a given dataset using the "range" endpoint : it seems to me that's enough ? |
* add .vscode to gitignore * add notebooks to gitignore * wip docstrings and fixes data.py * fix measures column issue in _parse_dataset_observations * fix(melodi): handle non-MELODI idbanks * test(melodi): add pytest coverage and fix update/silent signatures Signed-off-by: GrasClement <gras.clement@orange.fr> * test(melodi): finish tests for melodi Signed-off-by: GrasClement <gras.clement@orange.fr> * doc(melodi): add melodi to the documentation Signed-off-by: GrasClement <gras.clement@orange.fr> * doc(melodi): linting Signed-off-by: GrasClement <gras.clement@orange.fr> * doc(melodi): fix spacing Signed-off-by: GrasClement <gras.clement@orange.fr> * fix(melodi): simplify measures parsing, log empty idbank results Signed-off-by: GrasClement <gras.clement@orange.fr> * test(melodi): fix redundant checks and update comments per review Signed-off-by: GrasClement <gras.clement@orange.fr> * doc(melodi): reorder modules and flag metadata as deprecated Signed-off-by: GrasClement <gras.clement@orange.fr> --------- Signed-off-by: GrasClement <gras.clement@orange.fr> Co-authored-by: cgras <clement.gras@ccomptes.fr>
|
This should be ok, let's review @tfardet when you got time enough ! |
tfardet
left a comment
There was a problem hiding this comment.
Thanks @tgrandje and @GrasClement for this new additions.
I have a few points of discussions that I opened regarding naming and descriptions, let me know what you think.
| Get a dataset's available dimensions (ie "ranges"). | ||
|
|
||
| Available dimensions can be retrieved in a sparse format (with only | ||
| the dimensions' descriptions) or a long format (including all available | ||
| values for each dimension). |
There was a problem hiding this comment.
I'm a bit worried that this would not be very easy to understand for newcomers.
Should we maybe just start with "columns' names", then say that these can be called dimensions or ranges? I'm also wondering why we need to introduce an additional way of naming them with "dimension".
Same with the "sparse" format, since there is no "sparse" keyword, if it is mentioned there (should it be?), I think it should be associated to include_values to make the link explicit.
There was a problem hiding this comment.
Mmh, true enough. Fact is, the swagger currently describes "range[s]" in the endpoint, "dimensions et modalités" in the french description. To be coherent with API, I think we should stick to the "range" denomination, but that one is a bit obscure to me...
|
|
||
|
|
||
| @save_df(day_lapse_max=30) | ||
| def get_idbank( |
There was a problem hiding this comment.
shouldn't this be renamed to get_series_by_idbank/get_data_by_idbank or something similar?
current name feels misleading to me (I'd expect that the function helps me look for an idbank given a name or keywords)
There was a problem hiding this comment.
True. I'd go as far as to rename it as get_series as in macrodata ; do you have on objection on that (arguments will not be the same, but the logic stands I think).
| arguments should NOT be added to the kwargs and will be ignored. `range` | ||
| will also be ignored : to retrieve a dataset's dimensions, have a look at | ||
| `pynsee.melodi.get_range`. | ||
|
|
There was a problem hiding this comment.
move to numpy format:
Note
----
| from typing import Optional, Union | ||
| import warnings | ||
| from functools import lru_cache | ||
| from typing import Optional, Union |
There was a problem hiding this comment.
these are not needed anymore at the Python versions we support; should we take the opportunity to move to | bit by bit or do we want to keep that for a single PR that covers the whole code?
There was a problem hiding this comment.
We might want to make a full PR for python >= 3.11 instead? (I was also wondering how I came with the python >=3.10 in the pyproject.toml, I suspect I encountered dependencies conflicts at some point).
| from pynsee.download import * | ||
|
|
||
| __version__ = "0.2.5" | ||
| __version__ = "0.2.6" |
There was a problem hiding this comment.
we need to discuss this, that's not a bugfix release (long overdue, I'm afraid, my fault), we should probably jump to 0.3.0
There was a problem hiding this comment.
Yes you're right. Do you wan the 0.3.0 in here or in a ad hoc PR before release (I'm in favour of the 2nd option).
| "statistique", "démographie", "géospatial", "SIG" | ||
| ] | ||
| requires-python = ">=3.9" | ||
| requires-python = ">=3.10" |
There was a problem hiding this comment.
should we move to 3.11? 3.10 is no longer maintained? (I've no strong opinion about this)
There was a problem hiding this comment.
Sure, that PR was started some time ago 😄 ! Il fix this to 3.11, but we need a more serious PR for this afterwards (including badges, dependencies checkup, ...)
| @@ -0,0 +1 @@ | |||
| # -*- coding: utf-8 -*- | |||
There was a problem hiding this comment.
do we need the file? I don't think we do with pytest
There was a problem hiding this comment.
Uh, good question, I'll double check. If that's not needed anymore, I'll remove the other ones from previous tests.
Co-authored-by: tfardet <79037344+tfardet@users.noreply.github.com>
Co-authored-by: tfardet <79037344+tfardet@users.noreply.github.com>
Co-authored-by: tfardet <79037344+tfardet@users.noreply.github.com>
No description provided.