fix: storage #103
No reviewers
Labels
No labels
CRITICAL
Stale
WIP
bug
concept
coordinate
dataset
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
maintenance
maps
marker
mask
on hold
parcellation
preprocess
question
ready
storage
template-space
triage
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
juaml/junifer!103
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/storage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR improves the storage interface with a single method on
storage-likeobject intuitively calledstore(). It also fixes the interaction with the markers and lets the marker choose thekindof storage needed. Thestorage-likeobject is responsible for implementing the necessary methods whichmarker.store()and finallystorage.store()will call for example,store_timeseries(),store_table()andstore_matrix().As this was a major refactor for the internals, a lot of other minor changes had to implemented including method name changes, type annotations and docstring upgrades.
Codecov Report
94.91% <75.00%> (ø)92.30% <83.33%> (+0.30%)94.11% <89.47%> (-5.89%)91.48% <91.66%> (-8.52%)100.00% <100.00%> (ø)100.00% <100.00%> (ø)100.00% <100.00%> (ø)100.00% <100.00%> (ø)97.67% <100.00%> (+4.65%)94.24% <100.00%> (+1.42%)@ -104,8 +119,11 @@ class MarkerCollection:This should still be validate.
There are two methods:
validate_input: checks the inputget_output_kind: gives the output kind (given the input)validatecalls both of themSame here, the method should be
validateIt still should be the same:
validate. However, the storage has no output.This is kind of tricky.
read_featuresshould be able to read any kind of features: tables, matrix, nifti, etc.The previous name
read_df, aimed to tell you which kind of object you were getting.I'm sill not sure about this change. We might need to discuss it in the channel.
@ -104,8 +119,11 @@ class MarkerCollection:Okay makes sense since it comes from
PipelineStepMixin.So it raises an error if
validatefails?From what I see,
validateinSQLiteFeatureStoragereturns a bool.I see your point. Does it still remain an
abstractmethod?yes, at it really depends on the storage.
It should not. It should raise an error if it fails to validate the action.
What I understand from this is that all storage-like object need to have a way to read into DataFrames, right?
Okay then I'll make the changes.
@ -104,8 +119,11 @@ class MarkerCollection:Done.
@fraimondo waiting for your approval.
I'll check it now (testing the bot)
Not being tested?
Can we make it more specific here?
I know it will be a lot of logic, but we can actually tell the user which is the kind that we can't store.
Indeed this can go to the "base" class, as the _valid_inputs can be a parameter (like the "on" of markers)
Done.
Done.