Skip to content

Commit

Permalink
Add IntervalsDF (#256)
Browse files Browse the repository at this point in the history
* add IntervalsDF class and test cases

* making dataframe not acceptable input for IntervalsDF.disjoint

* add/remove TODOs

* only allow list type for 'identifers' and 'series' arguments in IntervalsDF

* first test passing; merging main before writing more tests

* all tests but one working

* fix mistake in test data

* refactor IntervalsDF and all same tests passing

* update test name for IntervalsDF

* all test passing for disjoint

* updates to toDF and all tests passing

* refactor disjoint in IntervalsDF to be composed of several helper functions and all tests passing with 100 percent cov

* cleanup test cases and simplify __merge_adjacent_overlaps

* rename identifers & identifier_cols to series & series_cols everywhere

* add sphinx build location to gitignore

* make interval_boundaries in IntervalsDF private

* docs and update to fromStackedMetrics to allow for metric_names arg

* black and mypy

* change series_cols arg in fromStackedMetrics to series

* final updates to fromStackedMetrics docstring

* update code blocks in docstrings to get rid of warnings that spark not found

* fix type in fromStackedMetrics docstring

* docstring for __merge_adjacent_subset_and_superset

* __merge_adjacent_overlaps logic clean up and add docstring. all tests passing

* comment formatting and cleanup

* docstrings and notes for everything but disjoint method in IntervalsDF

* formatting & minor updates

* removing uneeded assertions in protected methods

* formatting

* formatting

* remove TODO in IntervalsDF.disjoint

* docstring for IntervalsDF.disjoint and updates to IntervalsDF.__init__

* fix typing errors

* remove old todo

* refactored constructor for IntervalsDF and added some derived properties for identifying column metadata

* Black & Flake8 reformatting

Co-authored-by: Tristan Nixon <[email protected]>
  • Loading branch information
R7L208 and tnixon authored Sep 22, 2022
1 parent 38ec63f commit 99bc8c1
Show file tree
Hide file tree
Showing 8 changed files with 1,920 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ venv
# other misc ignore
.DS_Store
/docs/_build/

# sphinx build folder
docs/_build
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"sphinx.ext.viewcode",
"sphinx_panels",
"sphinx_copybutton",
"sphinx.ext.todo",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
3 changes: 2 additions & 1 deletion docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ API Reference

.. toctree::

tempo.tsdf
tempo.tsdf
tempo.intervals
5 changes: 5 additions & 0 deletions docs/reference/tempo.intervals.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tempo.intervals
===============

.. autoclass:: tempo.intervals.IntervalsDF
:members:
Loading

0 comments on commit 99bc8c1

Please sign in to comment.