Skip to content

enhance interfacing with metadata - #55

Open
alessandrofelder wants to merge 2 commits into
masterfrom
minor-tweaks-metadata
Open

enhance interfacing with metadata#55
alessandrofelder wants to merge 2 commits into
masterfrom
minor-tweaks-metadata

Conversation

@alessandrofelder

Copy link
Copy Markdown
Collaborator

a PR to address the items in #52 not covered in #54.

@alessandrofelder
alessandrofelder marked this pull request as draft June 4, 2020 11:20
@alessandrofelder
alessandrofelder force-pushed the minor-tweaks-metadata branch from 2a3c77b to 4bb5c82 Compare June 4, 2020 11:27
@codecov-commenter

codecov-commenter commented Jun 4, 2020

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.69%. Comparing base (cfd91b0) to head (cdc2b40).
⚠️ Report is 136 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #55   +/-   ##
=======================================
  Coverage   53.69%   53.69%           
=======================================
  Files          12       12           
  Lines        1583     1583           
  Branches      253      253           
=======================================
  Hits          850      850           
  Misses        697      697           
  Partials       36       36           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/silverlabnwb/nwb_file.py Outdated
raise ValueError("Start time for session not found!")
raise ValueError("Start time for session not found! "
"Please add a `start_time` parameter to sessions for user {}, "
"e.g. '10 May 2020 12:34:56.789103'"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe clarify that the time should be right after the key:

Suggested change
"e.g. '10 May 2020 12:34:56.789103'"
"e.g. start_time: 10 May 2020 12:34:56"

(also removing the decimals so as not to imply you need all the accuracy - the date/time parsing is quite flexible, I think)

Comment thread tests/test_metadata_import.py Outdated
Comment on lines +35 to +38
expected_error_string = "Start time for session not found! " \
"Please add a `start_time` parameter to sessions for user A, " \
"e.g. '10 May 2020 12:34:56.789103'"
assert expected_error_string == str(exc_info.value)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As this gets longer, maybe it's better to check only the beginning e.g.

assert str(exc_info.value).startswith(...)

or

assert "Start time for session not found!" in str(exc_info.value)

or even add a match=... argument to pytest.raises.
We lose some detail with any of these, but that only matters if we care about the exact content of the error message. In this case, maybe we can also assert that it contains start_time, since that is the essence of the change.

addresses some review comments
@alessandrofelder
alessandrofelder marked this pull request as ready for review August 27, 2020 09:35
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.

3 participants