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]: Python warning when executing validate #1953

Open
t-b opened this issue Sep 1, 2024 · 1 comment
Open

[Bug]: Python warning when executing validate #1953

t-b opened this issue Sep 1, 2024 · 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) topic: validator issues related to validation of files

Comments

@t-b
Copy link
Collaborator

t-b commented Sep 1, 2024

What happened?

I would expect no python warning from the below code:

Steps to Reproduce

Input:

python -m pynwb.validate --help

Output:

<frozen runpy>:128: RuntimeWarning: 'pynwb.validate' found in sys.modules after import of package 'pynwb', but prior to execution of 'pynwb.validate'; this may result in unpredictable behaviour
usage: validate.py [-h] [-lns] [-n NS] [--no-cached-namespace] paths [paths ...]

Validate an NWB file

positional arguments:
  paths                 NWB file paths

options:
  -h, --help            show this help message and exit
  -lns, --list-namespaces
                        List the available namespaces and exit.
  -n NS, --ns NS        the namespace to validate against
  --no-cached-namespace
                        Use the PyNWB loaded namespace (true) or use the cached namespace (false; default).

If --ns is not specified, validate against all namespaces in the NWB file.


### Traceback

_No response_

### Operating System

Linux

### Python Executable

Python

### Python Version

3.11

### Package Versions

$pip list
Package Version


attrs 24.2.0
h5py 3.11.0
hdmf 3.14.3
jsonschema 4.23.0
jsonschema-specifications 2023.12.1
numpy 1.26.4
pandas 2.2.2
pip 23.0.1
pynwb 2.8.1
python-dateutil 2.9.0.post0
pytz 2024.1
referencing 0.35.1
rpds-py 0.20.0
ruamel.yaml 0.18.6
ruamel.yaml.clib 0.2.8
scipy 1.14.1
setuptools 66.1.1
six 1.16.0
tzdata 2024.1


### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/.github/CODE_OF_CONDUCT.rst)
- [X] Have you checked the [Contributing](https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/docs/CONTRIBUTING.rst) document?
- [X] Have you ensured this bug was not already [reported](https://github.com/NeurodataWithoutBorders/pynwb/issues)?
@stephprince
Copy link
Contributor

Thanks for reporting this warning @t-b.

We will plan to address this warning when we change the organization of the validation methods - #1808

@stephprince stephprince self-assigned this Sep 3, 2024
@stephprince stephprince added category: bug errors in the code or code behavior topic: validator issues related to validation of files priority: low alternative solution already working and/or relevant to only specific user(s) labels Sep 3, 2024
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) topic: validator issues related to validation of files
Projects
None yet
Development

No branches or pull requests

2 participants