At the moment, pynsee is written with one file per class or function, with the files having the same name.
This seem to lead to name shadowing upon import (cf. #173) [1] and makes imports extremely cumbersome.
In my opinion, there is no good reason to have one file per function (especially not with the same name) as any good IDE will automatically locate definitions (even GitHub's web UI does this).
A simple way to do this with minimal changes would be to remove duplicate functions (no need to have get_geodata calling _get_geodata). So we can just keep _get_geodata.py which would contain get_geodata removing both one file, one function call, and the weird name shadowing issue.
For classes, we should follow the python convention and keep class files lowercase.
EDIT: we started doing this, this will continue progressively when time permits. Fixed classes and functions include:
[1]: though this is not supposed to happen (declared variables are supposed to have precedence over modules) so I'm not really sure why this led to bugs in the CI
At the moment,
pynseeis written with one file per class or function, with the files having the same name.This seem to lead to name shadowing upon import (cf. #173) [1] and makes imports extremely cumbersome.
In my opinion, there is no good reason to have one file per function (especially not with the same name) as any good IDE will automatically locate definitions (even GitHub's web UI does this).
A simple way to do this with minimal changes would be to remove duplicate functions (no need to have
get_geodatacalling_get_geodata). So we can just keep_get_geodata.pywhich would containget_geodataremoving both one file, one function call, and the weird name shadowing issue.For classes, we should follow the python convention and keep class files lowercase.
EDIT: we started doing this, this will continue progressively when time permits. Fixed classes and functions include:
GeoFrDataFrame,transform_overseasandzoomfromgeodataSireneDataFramefromsireneinit_connfromutilspynsee/macrodata(for dimensions, idbanks, and metdata) in Fixget_series_list#257[1]: though this is not supposed to happen (declared variables are supposed to have precedence over modules) so I'm not really sure why this led to bugs in the CI