[ENH]: Adopt Pydantic for schema validation #364

Merged
synchon merged 138 commits from feat/pydantic-validation into main 2026-05-26 11:07:28 +00:00
synchon commented 2025-11-13 16:20:32 +00:00 (Migrated from github.com)

Are you requiring a new dataset or marker?

  • I understand this is not a marker or dataset request

Which feature do you want to include?

We want to be able to validate the yaml so we avoid issues like #296

How do you imagine this integrated in junifer?

Use pydantic and validate the yaml.

Do you have a sample code that implements this outside of junifer?

No response

Anything else to say?

No response

### Are you requiring a new dataset or marker? - [X] I understand this is not a marker or dataset request ### Which feature do you want to include? We want to be able to validate the yaml so we avoid issues like #296 ### How do you imagine this integrated in junifer? Use pydantic and validate the yaml. ### Do you have a sample code that implements this outside of junifer? _No response_ ### Anything else to say? _No response_
codecov[bot] commented 2025-11-17 13:40:24 +00:00 (Migrated from github.com)

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6c48e06) to head (8851c3c).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main      #364      +/-   ##
===========================================
+ Coverage   91.55%   100.00%   +8.44%     
===========================================
  Files         146         1     -145     
  Lines        5744         1    -5743     
  Branches      929         0     -929     
===========================================
- Hits         5259         1    -5258     
+ Misses        313         0     -313     
+ Partials      172         0     -172     
Flag Coverage Δ
docs 100.00% <ø> (ø)
junifer ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
docs/conf.py 100.00% <ø> (ø)

... and 144 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
## [Codecov](https://app.codecov.io/gh/juaml/junifer/pull/364?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report :white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 100.00%. Comparing base ([`6c48e06`](https://app.codecov.io/gh/juaml/junifer/commit/6c48e06369325dc0797869cbbe8f142dcdb500c0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)) to head ([`8851c3c`](https://app.codecov.io/gh/juaml/junifer/commit/8851c3c154e97e6ad82d894a287a2be122015041?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)). :warning: Report is 7 commits behind head on main. <details><summary>Additional details and impacted files</summary> [![Impacted file tree graph](https://app.codecov.io/gh/juaml/junifer/pull/364/graphs/tree.svg?width=650&height=150&src=pr&token=5H21JuZXMw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)](https://app.codecov.io/gh/juaml/junifer/pull/364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #364 +/- ## =========================================== + Coverage 91.55% 100.00% +8.44% =========================================== Files 146 1 -145 Lines 5744 1 -5743 Branches 929 0 -929 =========================================== - Hits 5259 1 -5258 + Misses 313 0 -313 + Partials 172 0 -172 ``` | [Flag](https://app.codecov.io/gh/juaml/junifer/pull/364/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [docs](https://app.codecov.io/gh/juaml/junifer/pull/364/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `100.00% <ø> (ø)` | | | [junifer](https://app.codecov.io/gh/juaml/junifer/pull/364/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/juaml/junifer/pull/364?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [docs/conf.py](https://app.codecov.io/gh/juaml/junifer/pull/364?src=pr&el=tree&filepath=docs%2Fconf.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-ZG9jcy9jb25mLnB5) | `100.00% <ø> (ø)` | | ... and [144 files with indirect coverage changes](https://app.codecov.io/gh/juaml/junifer/pull/364/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) </details> <details><summary> :rocket: New features to boost your workflow: </summary> - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems. </details>
github-actions[bot] commented 2025-11-18 09:15:40 +00:00 (Migrated from github.com)
PR Preview Action v1.6.3

🚀 View preview at
https://juaml.github.io/junifer/pr-preview/pr-364/

Built to branch gh-pages at 2025-12-05 13:17 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

[PR Preview Action](https://github.com/rossjrw/pr-preview-action) v1.6.3 :---: | <p></p> :rocket: View preview at <br> https://juaml.github.io/junifer/pr-preview/pr-364/ <br><br> | <h6>Built to branch [`gh-pages`](https://github.com/juaml/junifer/tree/gh-pages) at 2025-12-05 13:17 UTC. <br> Preview will be ready when the [GitHub Pages deployment](https://github.com/juaml/junifer/deployments) is complete. <br><br> </h6> <!-- Sticky Pull Request Commentpr-preview -->
synchon commented 2025-11-18 09:38:40 +00:00 (Migrated from github.com)

CI passes on juseless.

CI passes on juseless.
synchon commented 2025-11-19 08:14:23 +00:00 (Migrated from github.com)

@fraimondo I have run quite a few of the YAMLs I have, would appreciate if you could run a couple of your most-used YAMLs with this branch. The YAMLs might require minimal changes which should be evident from the error raised.

@fraimondo I have run quite a few of the YAMLs I have, would appreciate if you could run a couple of your most-used YAMLs with this branch. The YAMLs might require minimal changes which should be evident from the error raised.
fraimondo (Migrated from github.com) requested changes 2025-11-26 11:20:30 +00:00
fraimondo (Migrated from github.com) left a comment

Overall looks promising. Though there are some changes that go against the easy-to-use QA:

  • Many parameters were str or list of str. Now they are lists. This adds the unnecessary burden to add a list in the YAMLs where the most common use case is to use a single element.

  • some parameters were str or Path and now they have to be Paths. This also makes it more complicated for users to define code. This can easily be validated later on and not with pydantic. Same for HttpUrl

  • I think there's an issue with the datadir which now will be part of the meta due to missing it's _. Also, there was a reason why it was not called fulldir in the datababber, but datadir, on purpose.

  • Some enums might add validation to pydantic, but will restraint the extensibility of junifer. E.g. DataType, ConfoundFormat, etc... These should be dynamic, as I might want to add some of them in an extension, without modifying junifer code.

Since there are 197 files changed, and many changes happen because of the first item. I will review more later with the next changes.

Overall looks promising. Though there are some changes that go against the easy-to-use QA: * Many parameters were `str or list of str`. Now they are lists. This adds the unnecessary burden to add a list in the YAMLs where the most common use case is to use a single element. * some parameters were `str or Path` and now they have to be Paths. This also makes it more complicated for users to define code. This can easily be validated later on and not with pydantic. Same for `HttpUrl` * I think there's an issue with the `datadir` which now will be part of the meta due to missing it's `_`. Also, there was a reason why it was not called `fulldir` in the datababber, but `datadir`, on purpose. * Some enums might add validation to pydantic, but will restraint the extensibility of junifer. E.g. DataType, ConfoundFormat, etc... These should be dynamic, as I might want to add some of them in an extension, without modifying junifer code. Since there are 197 files changed, and many changes happen because of the first item. I will review more later with the next changes.
fraimondo (Migrated from github.com) commented 2025-11-26 10:46:09 +00:00

Why suddenly this needs to be a list? It should be str or List[str]

Why suddenly this needs to be a list? It should be str or List[str]
@ -124,7 +124,7 @@ parcellation when registering it. For example, we can add a
markers:
fraimondo (Migrated from github.com) commented 2025-11-26 10:46:28 +00:00

Same here: str or list[str]

Same here: str or list[str]
fraimondo (Migrated from github.com) commented 2025-11-26 10:48:48 +00:00

Same as below.

Same as below.
fraimondo (Migrated from github.com) commented 2025-11-26 10:48:20 +00:00

With this change, now this line looks a bit lost in the docs. Maybe we should explicitly show that this is now a class attribute.

With this change, now this line looks a bit lost in the docs. Maybe we should explicitly show that this is now a class attribute.
fraimondo (Migrated from github.com) commented 2025-11-26 10:49:37 +00:00

I will stop commenting on this

I will stop commenting on this
fraimondo (Migrated from github.com) commented 2025-11-26 10:50:38 +00:00

The example should work without this "complicated" things from Pydantic.

The example should work without this "complicated" things from Pydantic.
fraimondo (Migrated from github.com) commented 2025-11-26 10:52:30 +00:00

Why here and not in line 186? Why is not done in the __init__ method of the WorkDirManager?

Why here and not in line 186? Why is not done in the `__init__` method of the `WorkDirManager`?
@ -19,0 +25,4 @@
_types = Literal[
DataType.BOLD,
DataType.T1w,
DataType.VBM_CSF,
fraimondo (Migrated from github.com) commented 2025-11-26 10:56:05 +00:00

should be a DataType of a list of them

should be a DataType of a list of them
fraimondo (Migrated from github.com) commented 2025-11-26 10:56:30 +00:00

Same for all the datagrabbers, markers, steps, etc where it can be one or many.

Same for all the datagrabbers, markers, steps, etc where it can be one or many.
@ -21,2 +25,3 @@
"""Abstract base class for DataGrabber.
class DataType(str, AEnum):
"""Accepted data type."""
fraimondo (Migrated from github.com) commented 2025-11-26 10:57:56 +00:00

Now we hit an important issue here.

How can I create a junifer extension that allows to process a new DataType (e.g. EEG)?

Now we hit an important issue here. How can I create a junifer extension that allows to process a new DataType (e.g. EEG)?
fraimondo (Migrated from github.com) commented 2025-11-26 10:59:40 +00:00

without an _ it will be considered part of the metadata for the computation of the hash. For Datalad-based datagrabbers, this should not count.

without an `_` it will be considered part of the metadata for the computation of the hash. For Datalad-based datagrabbers, this should not count.
fraimondo (Migrated from github.com) commented 2025-11-26 11:07:06 +00:00

I think that is why it's a property.

I think that is why it's a property.
@ -87,0 +140,4 @@
self._repodir.mkdir(parents=True, exist_ok=False)
logger.info(
"Datalad dataset installation path set to: "
f"{self._repodir.resolve()!s}"
fraimondo (Migrated from github.com) commented 2025-11-26 11:09:08 +00:00

this is horrible, what if the datadir was set by the user to datalad_dataset_aomic?

this is horrible, what if the datadir was set by the user to `datalad_dataset_aomic`?
fraimondo (Migrated from github.com) commented 2025-11-26 11:10:10 +00:00

It's missing the space in case it's dirty.

It's missing the space in case it's dirty.
@ -18,1 +22,4 @@
_types = Literal[DataType.BOLD, DataType.T1w, DataType.Warp]
fraimondo (Migrated from github.com) commented 2025-11-26 11:12:19 +00:00

will this expand? Otherwise I prefer the previous docstring as it tells you exactly what your options are.

will this expand? Otherwise I prefer the previous docstring as it tells you exactly what your options are.
fraimondo (Migrated from github.com) commented 2025-11-26 11:14:16 +00:00

Having an enum for the confounds format will also restrict someone defining their own format and using their own preprocessor for that format.

Having an enum for the confounds format will also restrict someone defining their own format and using their own preprocessor for that format.
synchon (Migrated from github.com) reviewed 2025-11-27 07:16:28 +00:00
synchon (Migrated from github.com) commented 2025-11-27 07:16:28 +00:00

Here's the present situation where one can't extend it: github.com/juaml/junifer@65be1297f8/junifer/datagrabber/pattern.py (L195-L203) . With this change they wouldn't be able to extend it either but can be made so with a couple of lines (see DataType).

Here's the present situation where one can't extend it: https://github.com/juaml/junifer/blob/65be1297f800bfe922a4d41848d66ab00cf2b195/junifer/datagrabber/pattern.py#L195-L203 . With this change they wouldn't be able to extend it either but can be made so with a couple of lines (see `DataType`).
synchon (Migrated from github.com) reviewed 2025-11-27 07:22:30 +00:00
@ -18,1 +22,4 @@
_types = Literal[DataType.BOLD, DataType.T1w, DataType.Warp]
synchon (Migrated from github.com) commented 2025-11-27 07:22:30 +00:00
Here's the doc link: https://juaml.github.io/junifer/pr-preview/pr-364/api/datagrabbers.html#junifer.datagrabber.DataladHCP1200 and here's the doc link for the enum: https://juaml.github.io/junifer/pr-preview/pr-364/api/datagrabbers.html#junifer.datagrabber.HCP1200Task
synchon (Migrated from github.com) reviewed 2025-11-27 07:24:41 +00:00
synchon (Migrated from github.com) commented 2025-11-27 07:24:41 +00:00

Without the change it prints double space in case it's dirty and with the change it does single space.

Without the change it prints double space in case it's dirty and with the change it does single space.
synchon (Migrated from github.com) reviewed 2025-11-27 07:28:09 +00:00
synchon (Migrated from github.com) commented 2025-11-27 07:28:08 +00:00

Here's where it gets removed and does not become part of hash computation: github.com/juaml/junifer@0f2ecf0ce7/junifer/storage/utils.py (L81-L86)

Here's where it gets removed and does not become part of hash computation: https://github.com/juaml/junifer/blob/0f2ecf0ce7082248a3c8ba0c9136bf62860620b2/junifer/storage/utils.py#L81-L86
synchon (Migrated from github.com) reviewed 2025-11-27 07:42:43 +00:00
@ -21,2 +25,3 @@
"""Abstract base class for DataGrabber.
class DataType(str, AEnum):
"""Accepted data type."""
synchon (Migrated from github.com) commented 2025-11-27 07:42:43 +00:00

Same way as one does now.

Same way as one does now.
synchon (Migrated from github.com) reviewed 2025-11-27 07:56:12 +00:00
synchon (Migrated from github.com) commented 2025-11-27 07:56:12 +00:00

Why here and not in line 186?

Nothing gets created until the datagrabber object is accessed, hence kept here. I don't have a problem moving it to L186.

Why is not done in the init method of the WorkDirManager?

It gives RecursionError if kept there.

> Why here and not in line 186? Nothing gets created until the datagrabber object is accessed, hence kept here. I don't have a problem moving it to L186. > Why is not done in the __init__ method of the WorkDirManager? It gives RecursionError if kept there.
synchon (Migrated from github.com) reviewed 2025-11-27 08:15:17 +00:00
@ -87,0 +140,4 @@
self._repodir.mkdir(parents=True, exist_ok=False)
logger.info(
"Datalad dataset installation path set to: "
f"{self._repodir.resolve()!s}"
synchon (Migrated from github.com) commented 2025-11-27 08:15:16 +00:00

Hmm that's a fair argument, I can do something like:

datadir = WorkDirManager().get_tempdir(
        prefix="datalad", suffix="juniferauto"
)

and then check with:

if self.datadir.stem.startswith(
    "datalad"
) and self.datadir.stem.endswith("juniferauto"):
Hmm that's a fair argument, I can do something like: ```python datadir = WorkDirManager().get_tempdir( prefix="datalad", suffix="juniferauto" ) ``` and then check with: ```python if self.datadir.stem.startswith( "datalad" ) and self.datadir.stem.endswith("juniferauto"): ```
synchon commented 2025-11-28 09:38:49 +00:00 (Migrated from github.com)
  • Many parameters were str or list of str. Now they are lists. This adds the unnecessary burden to add a list in the YAMLs where the most common use case is to use a single element.

All of them should be reverted now, let me know if you find any stray ones.

  • some parameters were str or Path and now they have to be Paths. This also makes it more complicated for users to define code.

Not at all, users can keep passing str and they'll be converted to Path by pydantic.

This can easily be validated later on and not with pydantic. Same for HttpUrl

The introduction of pydantic is primarily to not hand-roll these validations anymore and users should only need to add logical validations, but anyway these can be easily added via pydantic. HttpUrl is now AnyUrl and is same as the Path argument above.

  • I think there's an issue with the datadir which now will be part of the meta due to missing it's _.

Has been addressed in the specific comment.

Also, there was a reason why it was not called fulldir in the datababber, but datadir, on purpose.

The reason was to keep it in sync with non-datalad based datagrabbers and is already taken care of internally via introduction of _repodir. The UX should be exactly as it is now, let me know if you find any difference while using.

  • Some enums might add validation to pydantic, but will restraint the extensibility of junifer. E.g. DataType, ConfoundFormat, etc... These should be dynamic, as I might want to add some of them in an extension, without modifying junifer code.

Has been addressed in specific comments.

> * Many parameters were `str or list of str`. Now they are lists. This adds the unnecessary burden to add a list in the YAMLs where the most common use case is to use a single element. All of them should be reverted now, let me know if you find any stray ones. > * some parameters were `str or Path` and now they have to be Paths. This also makes it more complicated for users to define code. Not at all, users can keep passing `str` and they'll be converted to `Path` by pydantic. > This can easily be validated later on and not with pydantic. Same for `HttpUrl` The introduction of `pydantic` is primarily to not hand-roll these validations anymore and users should only need to add logical validations, but anyway these can be easily added via pydantic. `HttpUrl` is now `AnyUrl` and is same as the `Path` argument above. > * I think there's an issue with the `datadir` which now will be part of the meta due to missing it's `_`. Has been addressed in the specific comment. > Also, there was a reason why it was not called `fulldir` in the datababber, but `datadir`, on purpose. The reason was to keep it in sync with non-datalad based datagrabbers and is already taken care of internally via introduction of `_repodir`. The UX should be exactly as it is now, let me know if you find any difference while using. > * Some enums might add validation to pydantic, but will restraint the extensibility of junifer. E.g. DataType, ConfoundFormat, etc... These should be dynamic, as I might want to add some of them in an extension, without modifying junifer code. Has been addressed in specific comments.
fraimondo (Migrated from github.com) reviewed 2025-12-01 08:05:29 +00:00
fraimondo (Migrated from github.com) commented 2025-12-01 08:05:29 +00:00

but for non-datalad datagrabbers this should be counted.

but for non-datalad datagrabbers this should be counted.
fraimondo (Migrated from github.com) reviewed 2025-12-01 08:06:30 +00:00
@ -87,0 +140,4 @@
self._repodir.mkdir(parents=True, exist_ok=False)
logger.info(
"Datalad dataset installation path set to: "
f"{self._repodir.resolve()!s}"
fraimondo (Migrated from github.com) commented 2025-12-01 08:06:29 +00:00

why can't we keep a private var _was_cloned and check that? What if we "run a test without cleaning the workdir" and then we use it?

The behaviour should be "clean whatever mess you made".

why can't we keep a private var `_was_cloned` and check that? What if we "run a test without cleaning the workdir" and then we use it? The behaviour should be "clean whatever mess you made".
fraimondo (Migrated from github.com) reviewed 2025-12-01 08:08:09 +00:00
fraimondo (Migrated from github.com) commented 2025-12-01 08:08:09 +00:00
[junifer] pool-49-54 ➜ ~  ipython
Python 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:33:12) [Clang 15.0.7 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.16.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: is_dirty = True

In [2]: print(f"Remote dataset is{'' if is_dirty else ' not '}dirty")
Remote dataset isdirty

In [3]: is_dirty = False

In [4]: print(f"Remote dataset is{'' if is_dirty else ' not '}dirty")
Remote dataset is not dirty
``` [junifer] pool-49-54 ➜ ~ ipython Python 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:33:12) [Clang 15.0.7 ] Type 'copyright', 'credits' or 'license' for more information IPython 8.16.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: is_dirty = True In [2]: print(f"Remote dataset is{'' if is_dirty else ' not '}dirty") Remote dataset isdirty In [3]: is_dirty = False In [4]: print(f"Remote dataset is{'' if is_dirty else ' not '}dirty") Remote dataset is not dirty ```
fraimondo (Migrated from github.com) reviewed 2025-12-01 08:11:30 +00:00
@ -18,1 +22,4 @@
_types = Literal[DataType.BOLD, DataType.T1w, DataType.Warp]
fraimondo (Migrated from github.com) commented 2025-12-01 08:11:30 +00:00

Ok, so now I found that we have an even bigger problem with the DOC.

This is the "user documentation" where we show what we have available: https://juaml.github.io/junifer/pr-preview/pr-364/builtin.html

When you click on DataladHCP1200, it goes to the API doc, which is then this: https://juaml.github.io/junifer/pr-preview/pr-364/api/datagrabbers.html#junifer.datagrabber.DataladHCP1200

This is terrible for users. types is not a string anymore, neither tasks nor phase_encodings which makes it cryptic. "What shall I put in the field?" The previous docstring was easier to understand E.g. "use the string "REST1" and it will work!"

Ok, so now I found that we have an even bigger problem with the DOC. This is the "user documentation" where we show what we have available: https://juaml.github.io/junifer/pr-preview/pr-364/builtin.html When you click on DataladHCP1200, it goes to the API doc, which is then this: https://juaml.github.io/junifer/pr-preview/pr-364/api/datagrabbers.html#junifer.datagrabber.DataladHCP1200 This is terrible for users. `types` is not a string anymore, neither `tasks` nor `phase_encodings` which makes it cryptic. "What shall I put in the field?" The previous docstring was easier to understand E.g. "use the string "REST1" and it will work!"
fraimondo (Migrated from github.com) reviewed 2025-12-01 08:14:01 +00:00
fraimondo (Migrated from github.com) commented 2025-12-01 08:14:01 +00:00

I still don't understand how can I add a datatype in an extension.

I still don't understand how can I add a datatype in an extension.
synchon (Migrated from github.com) reviewed 2025-12-02 05:32:04 +00:00
synchon (Migrated from github.com) commented 2025-12-02 05:32:04 +00:00
You'd do as shown here: https://juaml.github.io/junifer/pr-preview/pr-364/extending/data_types.html
synchon (Migrated from github.com) reviewed 2025-12-02 06:37:47 +00:00
synchon (Migrated from github.com) commented 2025-12-02 06:37:47 +00:00

Should be fixed with the latest commit.

Should be fixed with the latest commit.
synchon (Migrated from github.com) reviewed 2025-12-02 08:47:12 +00:00
@ -87,0 +140,4 @@
self._repodir.mkdir(parents=True, exist_ok=False)
logger.info(
"Datalad dataset installation path set to: "
f"{self._repodir.resolve()!s}"
synchon (Migrated from github.com) commented 2025-12-02 08:47:12 +00:00

why can't we keep a private var _was_cloned and check that?

We already have _was_cloned for a similar purpose. I don't think I understand how you want it to be implemented.

> why can't we keep a private var `_was_cloned` and check that? We already have `_was_cloned` for a similar purpose. I don't think I understand how you want it to be implemented.
synchon (Migrated from github.com) reviewed 2025-12-02 09:15:23 +00:00
@ -18,1 +22,4 @@
_types = Literal[DataType.BOLD, DataType.T1w, DataType.Warp]
synchon (Migrated from github.com) commented 2025-12-02 09:15:23 +00:00

Should be addressed with the latest commit.

Should be addressed with the latest commit.
fraimondo (Migrated from github.com) reviewed 2026-05-19 09:08:32 +00:00
fraimondo (Migrated from github.com) commented 2026-05-19 09:08:32 +00:00

Can you implement the possibility to extend confound formats?

Can you implement the possibility to extend confound formats?
synchon commented 2026-05-19 11:20:26 +00:00 (Migrated from github.com)

@fraimondo I've pushed the further changes, feel free to review.

@fraimondo I've pushed the further changes, feel free to review.
fraimondo (Migrated from github.com) reviewed 2026-05-26 08:31:31 +00:00
fraimondo (Migrated from github.com) left a comment

Last questions

Last questions
fraimondo (Migrated from github.com) commented 2026-05-26 08:12:48 +00:00

We can already leave the typing in the template here

We can already leave the typing in the template here
fraimondo (Migrated from github.com) commented 2026-05-26 08:12:11 +00:00

Since they are datatypes, shouldn't they be DataType.T1w, etc? Or it is ok to keep them as strings?

Since they are datatypes, shouldn't they be DataType.T1w, etc? Or it is ok to keep them as strings?
@ -17,4 +17,5 @@ queue:
env:
kind: conda
name: junifer
shell: bash
fraimondo (Migrated from github.com) commented 2026-05-26 08:15:23 +00:00

We don't have bash as default here?

We don't have bash as default here?
fraimondo (Migrated from github.com) commented 2026-05-26 08:18:31 +00:00

This will happen a alot, might be worth having a "util" function to "update patterns".

This will happen a alot, might be worth having a "util" function to "update patterns".
fraimondo (Migrated from github.com) commented 2026-05-26 08:24:24 +00:00

Do we still need the on here? It's inherited from BaseMarker

Do we still need the `on` here? It's inherited from `BaseMarker`
fraimondo (Migrated from github.com) commented 2026-05-26 08:24:58 +00:00

There are many ocasions in which the on is repeated on the inherited marker.

There are many ocasions in which the `on` is repeated on the inherited marker.
synchon (Migrated from github.com) reviewed 2026-05-26 08:44:17 +00:00
synchon (Migrated from github.com) commented 2026-05-26 08:44:17 +00:00

They get automatically converted.

They get automatically converted.
synchon (Migrated from github.com) reviewed 2026-05-26 08:44:51 +00:00
synchon (Migrated from github.com) commented 2026-05-26 08:44:51 +00:00

What do you mean?

What do you mean?
synchon (Migrated from github.com) reviewed 2026-05-26 08:46:14 +00:00
@ -17,4 +17,5 @@ queue:
env:
kind: conda
name: junifer
shell: bash
synchon (Migrated from github.com) commented 2026-05-26 08:46:13 +00:00

Yes the default is bash, this is to be explicit.

Yes the default is bash, this is to be explicit.
synchon (Migrated from github.com) reviewed 2026-05-26 08:47:45 +00:00
synchon (Migrated from github.com) commented 2026-05-26 08:47:45 +00:00

Yes we need it to constrain the correct data types else any DataType will be valid.

Yes we need it to constrain the correct data types else any DataType will be valid.
synchon (Migrated from github.com) reviewed 2026-05-26 08:50:36 +00:00
synchon (Migrated from github.com) commented 2026-05-26 08:50:35 +00:00

I agree it has value and it's a dict so it should be straightforward to make one. I wouldn't want to do it in this PR though, might be good to tackle in another one.

I agree it has value and it's a dict so it should be straightforward to make one. I wouldn't want to do it in this PR though, might be good to tackle in another one.
fraimondo (Migrated from github.com) reviewed 2026-05-26 08:54:51 +00:00
fraimondo (Migrated from github.com) commented 2026-05-26 08:54:51 +00:00

This is supposed to be a template to create your own preprocessor:

_VALID_DATA_TYPES: ClassVar[Sequence[DataType]] = []
This is supposed to be a template to create your own preprocessor: ``` _VALID_DATA_TYPES: ClassVar[Sequence[DataType]] = [] ```
fraimondo (Migrated from github.com) reviewed 2026-05-26 08:55:12 +00:00
@ -17,4 +17,5 @@ queue:
env:
kind: conda
name: junifer
shell: bash
fraimondo (Migrated from github.com) commented 2026-05-26 08:55:12 +00:00

ok

ok
fraimondo (Migrated from github.com) reviewed 2026-05-26 08:56:27 +00:00
fraimondo (Migrated from github.com) commented 2026-05-26 08:56:27 +00:00

Before it was part of the "init" of each class, but now it has became something more "systematic" in the validation, which also makes the term validation a bit too loose. If you dont' want it in the PR, make an issue.

Before it was part of the "init" of each class, but now it has became something more "systematic" in the validation, which also makes the term validation a bit too loose. If you dont' want it in the PR, make an issue.
fraimondo (Migrated from github.com) reviewed 2026-05-26 08:56:39 +00:00
fraimondo (Migrated from github.com) commented 2026-05-26 08:56:38 +00:00

thought so.

thought so.
fraimondo (Migrated from github.com) approved these changes 2026-05-26 08:57:05 +00:00
fraimondo (Migrated from github.com) left a comment

One checks pass, good to go.

One checks pass, good to go.
synchon (Migrated from github.com) reviewed 2026-05-26 09:05:17 +00:00
synchon (Migrated from github.com) commented 2026-05-26 09:05:16 +00:00
Opened here: https://github.com/juaml/junifer/issues/497
synchon (Migrated from github.com) reviewed 2026-05-26 09:05:40 +00:00
synchon (Migrated from github.com) commented 2026-05-26 09:05:40 +00:00

Addressed in latest commit.

Addressed in latest commit.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer!364
No description provided.