-
Notifications
You must be signed in to change notification settings - Fork 25
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
Renamed failing test, added prospective use case for NWBI warning. #1162
Conversation
Codecov ReportBase: 88.22% // Head: 88.23% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1162 +/- ##
==========================================
+ Coverage 88.22% 88.23% +0.01%
==========================================
Files 73 73
Lines 8804 8817 +13
==========================================
+ Hits 7767 7780 +13
Misses 1037 1037
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
The code at L504-L509 was designed to be extremely minimal on the DANDI side; in particular, prior to the introduction of dandi warning levels (this new severity thing) the Inspector was only capable of returning items that ought to prevent validation of files ( In the relevant
The idea being, previously, that someone could merely run So to achieve this, all you need to do is not specify the For reference, you can find the config maintained here: https://github.com/NeurodataWithoutBorders/nwbinspector/blob/dev/src/nwbinspector/internal_configs/dandi.inspector_config.yaml |
Note that a bare-minimal NWBFile (one with only a
|
@CodyCBakerPhD thank you for the description of the mechanics, I think I understand what the main issue is now :) Sadly, as soon as I set
Do you perhaps have an inkling what this might be about, or should I upload a separate branch with the actual code that produces it? In any case I can't trigger any |
@CodyCBakerPhD I have added a50c4fe which should exemplify the status of the code that produces the issue mentioned above. I'll switch it back to BEST_PRACTICE_VIOLATION in the next one. Regarding that, do you perhaps know how I can create an NWB file which has a timeseries and therefore can produce the BEST_PRACTICE_VIOLATION importance level without at the same time missing a subject? The code examples I found for timeseries do not have a subject, and I wasn't able to add a timeseries to an NWB object with subject info: @pytest.fixture(scope="session")
def simple4_nwb(
simple1_nwb_metadata: Dict[str, Any], tmp_path_factory: pytest.TempPathFactory
) -> str:
"""
With, subject, subject_id, species, but including data orientation ambiguity,
the only currently non-critical issue in the dandi schema for nwbinspector validation:
https://github.com/NeurodataWithoutBorders/nwbinspector/blob/
54ac2bc7cdcb92802b9251e29f249f155fb1ff52
/src/nwbinspector/internal_configs/dandi.inspector_config.yaml#L10
"""
from datetime import datetime, timezone
start_time = datetime(2017, 4, 3, 11, tzinfo=timezone.utc)
create_date = datetime(2017, 4, 15, 12, tzinfo=timezone.utc)
time_series=pynwb.TimeSeries(
name="test_time_series",
unit="test_units",
data=np.zeros(shape=(2, 100)),
rate=1.0,
)
nwbfile = NWBFile(
session_description="demonstrate external files",
identifier="NWBE4",
session_start_time=start_time,
file_create_date=create_date,
age="P1D/",
sex="O",
species="Mus musculus",
)
nwbfile.add_acquisition(time_series)
filename = str(tmp_path_factory.mktemp("simple4") / "simple4.nwb")
with pynwb.NWBHDF5IO(filename, "w") as io:
io.write(nwbfile, cache_spec=False)
return filename gives me:
|
Subjects are added as nwbfile = NWBFile(
session_description="demonstrate external files",
identifier="NWBE4",
session_start_time=start_time,
subject=Subject(
age="P1D/",
sex="O",
species="Mus musculus",
)
) I'm looking into those other issues now |
also improved test function docstrings
there must be a better way of putting longer links in docstrings...
@CodyCBakerPhD thanks again for your help :) I think I finally got a test case nailed down. As for the aforementioned threshold issue, that's not strictly related to this PR, for now we're setting |
Addressing #1158
The issue with the latter is that for validation via DANDI there is only one none-critical type of error, namely
check_data_orientation
. Though going by the comment that too appears to be temporary.@CodyCBakerPhD (1) do you know how I could create a test case for this if this will likely be long-term-stable behaviour or (2) is there anything else we could add as
BEST_PRACTICE_VIOLATION
(apparently the second-highest criterion for NWBI errors) so that we can check warning reporting functionality?