-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Best Practices] Add check for TimeSeries
unit follows CMIXF-12
convention
#281
Draft
weiglszonja
wants to merge
15
commits into
NeurodataWithoutBorders:dev
Choose a base branch
from
catalystneuro:add_check_for_unit_follows_CMIXF-12
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0ab683b
add check for unit formatting complies with CMIXF-12
weiglszonja 257e292
add cmixf to requirements.txt
weiglszonja ac22c09
add unittests for check_unit_formatting
weiglszonja a9f5e90
add units formatting as new section with examples
weiglszonja 5641e1a
extend best practice for TimeSeries with unit formatting
weiglszonja 842e0f1
add unit formatting to appear at the end of best practices
weiglszonja 82329ac
Merge branch 'dev' into add_check_for_unit_follows_CMIXF-12
weiglszonja 2dfb82b
fix derived unit test
weiglszonja ac5888c
Merge remote-tracking branch 'origin/add_check_for_unit_follows_CMIXF…
weiglszonja bba0820
Apply suggestions from code review
weiglszonja f4aad15
fix unittest
weiglszonja 1d1e0c8
use CMIXFLexer instead of parser
weiglszonja 8964521
move CMIXF-12 into Units of Measurement
weiglszonja f2f7017
fix reference for best_practice_unit_of_measurement
weiglszonja 655a97f
extend examples
weiglszonja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.. _units: | ||
|
||
Units Formatting | ||
================ | ||
|
||
As described in the :ref:`best_practice_unit_of_measurement`, | ||
the specification of units should follow the International System of Units (SI). | ||
|
||
The `CMIXF-12 <https://people.csail.mit.edu/jaffer/MIXF/CMIXF-12>`_ convention for encoding | ||
SI units is recommended to minimize the variability of representation of unit values. | ||
If the unit of measurement is unknown or unavailable, the unit can be declared as "a.u." | ||
which stands for arbitrary units. | ||
Please note the appropriate upper- or lower- casing when using CMIXF-12. | ||
|
||
The `cmixf <https://github.com/sensein/cmixf>`_ Python package is used to check whether | ||
the formatting of unit is compliant. | ||
|
||
Unit table | ||
^^^^^^^^^^ | ||
.. list-table:: | ||
:widths: 25 25 50 | ||
:align: center | ||
:header-rows: 1 | ||
|
||
* - Neurodata type | ||
- Unit in CMIXF-12 | ||
- Unit Name | ||
* - :py:class:`~pynwb.behavior.SpatialSeries` | ||
- "m" | ||
- Meters | ||
* - :py:class:`~pynwb.ecephys.ElectricalSeries` | ||
- "V" | ||
- Volts | ||
* - :py:class:`~pynwb.ecephys.SpikeEventSeries` | ||
- "V" | ||
- Volts | ||
* - :py:class:`~pynwb.icephys.PatchClampSeries` | ||
- "V" | ||
- Volts | ||
* - :py:class:`~pynwb.icephys.CurrentClampSeries` | ||
- "V" | ||
- Volts | ||
* - :py:class:`~pynwb.icephys.IZeroClampSeries` | ||
- "V" | ||
- Volts | ||
* - :py:class:`~pynwb.icephys.CurrentClampStimulusSeries` | ||
- "A" | ||
- Amperes | ||
* - :py:class:`~pynwb.icephys.VoltageClampSeries` | ||
- "A" | ||
- Amperes | ||
* - :py:class:`~pynwb.icephys.VoltageClampStimulusSeries` | ||
- "V" | ||
- Volts | ||
* - :py:class:`~pynwb.image.ImageSeries` | ||
- "a.u." | ||
- Arbitrary Units (unknown) | ||
* - :py:class:`~pynwb.image.IndexSeries` | ||
- "a.u." | ||
- Arbitrary Units (unknown) | ||
* - :py:class:`~pynwb.image.ImageMaskSeries` | ||
- "a.u." | ||
- Arbitrary Units (unknown) | ||
* - :py:class:`~pynwb.image.OpticalSeries` | ||
- "a.u." | ||
- Arbitrary Units (unknown) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lexer.tokenize()
agenerator
object, when a bad character is found it immediately raises an error. e.g.would return the recognized token value for unit t
Token(type='UNITC', value='t', lineno=1, index=0)
next(tokens)
would return:
{ValueError}Line 1: Bad character 'a'