Skip to content

API: Replace .type_various()#3074

Merged
Lestropie merged 11 commits intodevfrom
no_type_various
Nov 17, 2025
Merged

API: Replace .type_various()#3074
Lestropie merged 11 commits intodevfrom
no_type_various

Conversation

@Lestropie
Copy link
Member

Closes #2580.
Supersedes #3067.
More info via 3ce5b54.

Knew that fixing what I think is the wrong implementation via #3067 was going to irritate me; so went ahead and re-implemented in the way I think is preferable. The changes to the CLI tests should show what's different.

For __print_full_usage__ (which remains unused elsewhere to the best of my knowledge), I chose to keep all possible types for a given command-line argument on the same line, with INT / FLOAT always followed by two lower and upper bounds, and CHOICE is always the last one in the list given the risk of one of the possible input strings clashing with one of the argument type identifiers.

Some command-line arguments could be one of multiple types, depending on the user's desired input / behaviour. Rather than simply flagging all such instances as "various", thereby placing zero restrictions on inputs and providing minimal information on the interface internally, instead utilise each command-line argument type as a bitwise flag, allowing each command-line argument to nominate what types of input are allowed vs. not.
Note that this requires some care internally within the command-line parsing: requirements at the point of command-line parsing can typically only be imposed if the argument type is exclusive.
Also fixes some non-functional checks on the CLIs, which neglected to detect expected deviations from previous behaviour.
Closes #2580.
Supersedes #3067.
@Lestropie Lestropie added this to the 3.1.0 updates milestone Mar 11, 2025
@Lestropie Lestropie self-assigned this Mar 11, 2025
Prior to 16dc6b8 these tets were not being properly assessed, which allowed out-of-date copyright headers to persist in the reference test data.
@Lestropie Lestropie requested a review from a team March 13, 2025 23:16
@Lestropie
Copy link
Member Author

Lestropie commented Aug 15, 2025

  • Given strong CLI typing now present for Python on dev, need to remove app.Parser.Various and replace any instances of such with new classes that will infer the type based on the set of possible data types and the user input string and return a value of appropriate type accordingly.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

Lestropie and others added 3 commits September 15, 2025 16:44
Remove user-friendly message if user attempts to provide as input to fixelcfestats a tractogram rather than a pre-computed fixel-fixel connectivity matrix, given that this change in interface is now five years old.
github-actions[bot]

This comment was marked as outdated.

@Lestropie
Copy link
Member Author

Lestropie commented Sep 24, 2025

  • Consider adoption of std::bitset as part of this PR.

github-actions[bot]

This comment was marked as outdated.

@Lestropie
Copy link
Member Author

Lestropie commented Nov 11, 2025

Merging with #3116 has broken tests here: "unit tests" are now run in parallel, but some of the tests do involve the writing of filesystem content, and this is resulting in one test deleting the intermediate content from another test. So either:

  • This parallelism needs to be disabled
  • "Unit tests" needs to be further segmented into tests that write filesystem content and tests that do not (though more categorical criteria would be preferable), with explicit calls in the GitHub Action with / without parallelism;
  • Tests need to avoid writing to the filesystem where possible.

The guilty parties are:

  • The CLI tests: could go into a separate "UI tests" category.
  • The NPY tests: "compatibility tests"?
    Edit: "Integration" tests might actually suit, even though the "integration" is with an external format.

These tests involve filesystem manipulations, and therefore cannot be executed in parallel due to mass erasing of any filesystem content beginning with "tmp*" for all tests.
- Change "format" function argument for many help-page-generating functions from int to bool, as it is only ever evaluated as a bool.
- Add default functions to ArgModifierFlags class for clang-tidy.
github-actions[bot]

This comment was marked as outdated.

@Lestropie Lestropie requested a review from daljit46 November 11, 2025 22:11
@daljit46
Copy link
Member

This LGTM. I also agree with renaming tests that aren't independent (unit tests should always be IMO).

@Lestropie Lestropie merged commit fa6ee95 into dev Nov 17, 2025
6 checks passed
@Lestropie Lestropie deleted the no_type_various branch November 17, 2025 01:36
Lestropie added a commit to Lestropie/dwidenoise2 that referenced this pull request Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants