Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: External file format error on ImageSeries #2041

Open
3 tasks done
stephprince opened this issue Feb 27, 2025 · 1 comment
Open
3 tasks done

[Bug]: External file format error on ImageSeries #2041

stephprince opened this issue Feb 27, 2025 · 1 comment
Assignees
Labels
category: bug errors in the code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s)

Comments

@stephprince
Copy link
Contributor

What happened?

When creating a new ImageSeries with an external file, pynwb now throws an error if format is not specified as "external", even if no format value was provided.

Would it be better for this to remain a warning (or removed entirely), since it is just informing the user that the value for format was automatically set to "external" because no format parameter was provided? Or should a user always have to add the format='external' argument when providing external data.

There is a separate check in the ImageSeries initialization if a different value for format is provided (e.g. if format='png' when external_file is present).

Steps to Reproduce

from pynwb.image import ImageSeries
image_series = ImageSeries(
            name="TestImageSeries",
            rate=1.0,
            external_file=["test.png"],
        )

Traceback

ImageSeries 'TestImageSeries': The value for 'format' has been changed to 'external'. If an external file is detected, setting a value for 'format' other than 'external' is deprecated.

Operating System

macOS

Python Executable

Conda

Python Version

3.13

Package Versions

No response

Code of Conduct

@stephprince stephprince added category: bug errors in the code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s) labels Feb 28, 2025
@rly
Copy link
Contributor

rly commented Mar 5, 2025

I think if the format is the default None and an external file is detected, then the format should be changed to "external" and no message should be sent. If the format is something that is not [None, "external"] and an external file is detected, an error should be raised.

@stephprince stephprince self-assigned this Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug errors in the code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s)
Projects
None yet
Development

No branches or pull requests

2 participants