Skip to content

Add bintime submodule - #73

Merged
bkeryan merged 33 commits into
mainfrom
users/bkeryan/bintime
Jun 5, 2025
Merged

bkeryan merged 33 commits into
mainfrom
users/bkeryan/bintime

Conversation

@bkeryan

@bkeryan bkeryan commented May 24, 2025 •

Copy link
Copy Markdown
Collaborator

What does this Pull Request accomplish?

Add the nitypes.bintime module, which implements binary time types using NI Binary Time Format (NI-BTF).

TODO in this PR:

  • Write tests for nitypes.time._conversion bintime support

Subsequent PRs:

  • AB#3137071 - Add conversion between the NumPy and Python representations
  • AB#3094390 - Define NI-BTF waveform timing object

Why should this Pull Request be merged?

Closes AB#3066180 - Define Python NI-BTF (Binary Time Format) time data type

What testing has been done?

  • Ran unit tests
  • Checked coverage for gaps

@bkeryan
bkeryan requested a review from csjall as a code owner May 24, 2025 01:36
@github-actions

github-actions Bot commented May 24, 2025 •

Copy link
Copy Markdown
Contributor

Test Results

    12 files  ±    0      12 suites  ±0   55s ⏱️ +17s
 1 205 tests +  353   1 197 ✅ +  345   8 💤 + 8  0 ❌ ±0 
14 328 runs  +4 104  14 232 ✅ +4 008  96 💤 +96  0 ❌ ±0 

Results for commit a9488a4. ± Comparison against base commit 8e0f545.

♻️ This comment has been updated with latest results.

Comment thread src/nitypes/bintime/_absolute_time.py Outdated
Comment thread src/nitypes/bintime/_absolute_time.py Outdated
Comment thread src/nitypes/time/_conversion.py Outdated
Comment thread tests/unit/bintime/test_absolute_time.py Outdated
Comment thread src/nitypes/bintime/_absolute_time.py Outdated
Comment thread tests/unit/bintime/test_absolute_time.py Outdated

@csjall csjall left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved pending missing TODO items

@bkeryan
bkeryan force-pushed the users/bkeryan/bintime branch from 470dbda to 2e308aa Compare June 4, 2025 16:35
Comment thread tests/unit/bintime/test_datetime.py Outdated
Comment thread src/nitypes/bintime/_datetime.py
@bkeryan

bkeryan commented Jun 5, 2025

Copy link
Copy Markdown
Collaborator Author

The tests are failing on Python 3.9:

________ ERROR collecting tests/unit/waveform/_timing/test_precision.py ________
tests/unit/waveform/_timing/test_precision.py:11: in <module>
    from nitypes.waveform import PrecisionTiming, SampleIntervalMode
src/nitypes/waveform/__init__.py:104: in <module>
    from nitypes.waveform._analog import AnalogWaveform
src/nitypes/waveform/_analog.py:12: in <module>
    from nitypes.waveform._numeric import NumericWaveform, _TOtherScaled
src/nitypes/waveform/_numeric.py:33: in <module>
    from nitypes.waveform._timing import BaseTiming, PrecisionTiming, Timing, convert_timing
src/nitypes/waveform/_timing/__init__.py:4: in <module>
    from nitypes.waveform._timing._conversion import convert_timing
src/nitypes/waveform/_timing/_conversion.py:12: in <module>
    from nitypes.time._conversion import convert_datetime, convert_timedelta
src/nitypes/time/__init__.py:3: in <module>
    from nitypes.time._conversion import convert_datetime, convert_timedelta
src/nitypes/time/_conversion.py:11: in <module>
    import nitypes.bintime as bt
src/nitypes/bintime/__init__.py:74: in <module>
    from nitypes.bintime._datetime import DateTime
src/nitypes/bintime/_datetime.py:11: in <module>
    from nitypes.bintime._timedelta import (
src/nitypes/bintime/_timedelta.py:42: in <module>
    class TimeDelta:
src/nitypes/bintime/_timedelta.py:102: in TimeDelta
    def _(cls, seconds: SupportsIndex) -> int:
/opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/functools.py:933: in register
    return self.dispatcher.register(cls, func=method)
/opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/functools.py:870: in register
    argname, cls = next(iter(get_type_hints(func).items()))
/opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/typing.py:1497: in get_type_hints
    value = _eval_type(value, globalns, localns)
/opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/typing.py:292: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/typing.py:554: in _evaluate
    eval(self.__forward_code__, globalns, localns),
<string>:1: in <module>
    ???
E   NameError: name 'SupportsIndex' is not defined

This looks like the issue described in python/cpython#86153 .

@bkeryan bkeryan changed the title [RFC/preview] Add bintime submodule Add bintime submodule Jun 5, 2025
@bkeryan
bkeryan merged commit f857427 into main Jun 5, 2025
@bkeryan
bkeryan deleted the users/bkeryan/bintime branch June 5, 2025 21:56
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.

2 participants