Skip to content

Commit

Permalink
Rollback of changes to loadclass boundaries because it was in conflic…
Browse files Browse the repository at this point in the history
…t with testcase in literature
  • Loading branch information
Gunnstein committed Jun 4, 2024
1 parent 8ed283d commit 9918e3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fatpack/rainflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_load_class_boundaries(y, k=64, ymin=None, ymax=None):
dy = (ymax-ymin) / (2.0*k)
y0 = ymin - dy
y1 = ymax + dy
return np.linspace(y0, y1, k+1)
return np.linspace(y0, y1, k+2)


def find_reversals_strict(y, k=64, ymin=None, ymax=None):
Expand Down
10 changes: 5 additions & 5 deletions fatpack/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class TestFindReversalsStrict(BaseArrayTestCase, unittest.TestCase):
def setUp(self):
self.result_true = TESTDATA['reversals']
y = TESTDATA['dataseries']
self.result, __ = find_reversals_strict(y, k=12)
self.result, __ = find_reversals_strict(y, k=11)


class TestConcatenateResidue(BaseArrayTestCase, unittest.TestCase):
Expand Down Expand Up @@ -125,22 +125,22 @@ class TestGetLoadClasses(BaseArrayTestCase, unittest.TestCase):
def setUp(self):
self.result_true = TESTDATA['classes']
y = TESTDATA['dataseries']
self.result = get_load_classes(y, k=12)
self.result = get_load_classes(y, k=11)


class TestGetLoadClassBoundaries(BaseArrayTestCase, unittest.TestCase):
def setUp(self):
self.result_true = TESTDATA['class_boundaries']
y = TESTDATA['dataseries']
self.result = get_load_class_boundaries(y, k=12)
self.result = get_load_class_boundaries(y, k=11)


class TestGetLoadClassBoundariesMinMax(BaseArrayTestCase, unittest.TestCase):
def setUp(self):
self.result_true = TESTDATA['class_boundaries_minmax']
y = TESTDATA['dataseries']
yRange = np.max(y) - np.min(y)
self.result = get_load_class_boundaries(y, k=12, ymin=np.min(y) - yRange/2, ymax=np.max(y) + yRange/2)
self.result = get_load_class_boundaries(y, k=11, ymin=np.min(y) - yRange/2, ymax=np.max(y) + yRange/2)


class TestFindRainflowMatrix(BaseArrayTestCase, unittest.TestCase):
Expand Down Expand Up @@ -171,7 +171,7 @@ class TestFindRainflowRangesStrict(BaseArrayTestCase, unittest.TestCase):
def setUp(self):
self.result_true = TESTDATA['ranges_total_strict']
self.result = find_rainflow_ranges_strict(
TESTDATA['dataseries'], k=12)
TESTDATA['dataseries'], k=11)


class TestFindRangeCount(unittest.TestCase):
Expand Down

0 comments on commit 9918e3e

Please sign in to comment.