Open xgui3783 opened 1 month ago
attn @AhmetNSimsek
per our discussion, here is the WIP
left to do:
refactor todo list
{method}_iter()
get_region()
find()
get_regional_map()
siibra/attr/meta/doi
-> siibra/attr/desc/url
see https://github.com/FZJ-INM1-BDA/siibra-configurations/commit/9806628c4a6e9dec04627622c61665dee15314c9
url
-> value
siibra/attr/data/voi
-> siibra/attr/data/image
see https://github.com/FZJ-INM1-BDA/siibra-configurations/commit/9806628c4a6e9dec04627622c61665dee15314c9
regionspec
see https://github.com/FZJ-INM1-BDA/siibra-configurations/commit/9806628c4a6e9dec04627622c61665dee15314c9
name
-> value
Image
subclassing Location
) @AhmetNSimsek siibra-schema
repo see https://github.com/FZJ-INM1-BDA/siibra-schema region.find
is not deterministic and rather slow. I am noting down to investigate later.
@xgui3783, I think we should remove the dataclass
decorators from classes that inherit other a class that has a dataclass
decorator. Because it creates unexpected behaviors such as some methods are overridden and very difficult to debug as it is an unexpected behavior.
Regarding being explicit: if a class A
inherits a class B
with dataclass
decorators, the developer would know that A
is also a dataclass
. So, by repeating the 2 lines required to decorate class A
as a dataclass
, we break DRY, we face unexpected behavior, and we don't gain anything besides being explicit which is not really necessary in this context.
This changes if the class has extra members. Then, it is needed to use the decorator as the __init__
needs to be overridden. I suggest we remove all we can and leave only the necessary implementations. What do you think?
supercedes https://github.com/FZJ-INM1-BDA/siibra-python/pull/553
EDIT: The tests are turned off, except for the ones in examples_new to see if there is regression. The remaining test migration will be made gradually. (b70abe9f03533c684207462d5407dee96bed459d and 8a47f0feff6d6bd760ddce3e1ba0df1246c0955a)