Skip to content

pass None for default preprocessing config - #178

Open
alessandrofelder wants to merge 6 commits into
mainfrom
allow-none-config
Open

pass None for default preprocessing config#178
alessandrofelder wants to merge 6 commits into
mainfrom
allow-none-config

Conversation

@alessandrofelder

@alessandrofelder alessandrofelder commented Mar 26, 2026

Copy link
Copy Markdown
Member

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

Following group meeting discussion, we decided that it should be possible to run preprocess without needing any configuration object. This simplifies the code that people need to understand when working through a basic template-building guide.

What does this PR do?

Allows preprocess function to take a None config (now the default), and handles this by instantiating a default PreprocConfig and MaskConfig in the sibling folder of standardised.

Also ignores read time-outs to biorxiv for link checker.

References

Related to internal discussion of brainglobe/brainglobe.github.io#465

How has this PR been tested?

Added a parameter to an existing unit test

Is this a breaking change?

Nope

Does this PR require an update to the documentation?

Docstrings updated.
Part of simplifying API to enable better documentation in brainglobe/brainglobe.github.io#465

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@alessandrofelder
alessandrofelder marked this pull request as ready for review March 26, 2026 17:03
"""

if isinstance(config, Path):
if not config:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes config is truthy. its fine but it would be safer to say if config is None

)

logger.info(f"Csv file path: {standardised_csv}")
logger.info(f"Config: {config}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you should now log preproc_config so that its not None

if not config:
# use default mask and padding, and default to outputting
# into sibling folder of `standardised/`
preproc_config = PreprocConfig(

@PolarBean PolarBean May 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just define MaskConfig() as the default argument for PreprocConfig simplify.

@PolarBean

Copy link
Copy Markdown
Member

Some small suggestions but overall looks good :)

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