-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create placeholder class for NormalizedDataManager
- Loading branch information
1 parent
4d9400e
commit c16a87b
Showing
5 changed files
with
55 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
"""Paxplot modules""" | ||
from .core import pax_parallel, PaxFigure | ||
from .datasets import * | ||
from .data_managers import * |
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,2 @@ | ||
"""Data managers for paxplot""" | ||
from .normalized import * |
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,21 @@ | ||
"""Class for NormalizedDataManager""" | ||
|
||
|
||
class NormalizedDataManager(): | ||
""" | ||
Manages data and a normalized (between 0 and 1) representation of that same data | ||
""" | ||
|
||
def __init__(self): | ||
self.true_data = [] | ||
self.normalized_data = [] | ||
|
||
|
||
def append(self, data=list): | ||
"""Append data to manager. Updates both the true and normalized data. | ||
Args: | ||
data (_type_, optional): _description_. Defaults to list. | ||
""" | ||
self.true_data = data | ||
self.normalized_data = data |
Empty file.
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,30 @@ | ||
"""Tests for NormalizedDataManager""" | ||
|
||
import unittest | ||
import paxplot | ||
|
||
|
||
class NormalizedDataManagerTests(unittest.TestCase): | ||
"""Tests for NormalizedDataManager | ||
Args: | ||
unittest (_type_): _description_ | ||
""" | ||
|
||
def test_append_success(self): | ||
""" | ||
Basic appending data | ||
""" | ||
# Arrange | ||
data = [ | ||
[0.0, 0.0], | ||
[1.0, 1.0], | ||
[2.0, 2.0] | ||
] | ||
paxdataset = paxplot.data_managers.NormalizedDataManager() | ||
|
||
# Act | ||
paxdataset.append(data) | ||
|
||
# Assert | ||
self.assertEqual(paxdataset.true_data[0][0], 0.0) |