Skip to content

Commit

Permalink
Added racetrack filter module.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunnstein committed Mar 10, 2019
1 parent b3d1c04 commit 801b0ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion fatpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
unicode_literals)
from .rainflow import *
from .endurance import *
from .racetrack import *

__version__ = "0.5.8"
__version__ = "0.6.0"
2 changes: 1 addition & 1 deletion fatpack/rainflow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
Implementation of 4-point rainflow counting algorithm in numpy. The
implementation and terminology is based off on the following resources:
implementation and terminology is based on the following resources:
`C. Amzallag et. al. Standardization of the rainflow counting method for
fatigue analysis. International Journal of Fatigue, 16 (1994) 287-293`
Expand Down
12 changes: 11 additions & 1 deletion fatpack/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import numpy as np
import unittest
from .rainflow import (get_load_classes, get_load_class_boundaries,
find_reversals_strict, find_rainflow_ranges_strict)
find_reversals_strict, find_rainflow_ranges_strict,
)
from . import *

TESTDATA = dict(
Expand Down Expand Up @@ -193,5 +194,14 @@ def test_get_bilinear_endurance(self):
self.assertEqual(f, s)


class TestRaceTrackFilter(BaseArrayTestCase, unittest.TestCase):
def setUp(self):
self.result_true = np.array(
[4.2, 7.3, 2., 10.3, 5.2, 8.5, 2.2, 12., 5.5, 11.1, 1.,
9.5, 6., 12., 3.9, 8.3, 1.2, 8.6, 3.9, 6.2])
y = TESTDATA['dataseries']
self.result, _ = find_reversals_racetrack_filtered(y, 2, k=64)


if __name__ == "__main__":
unittest.main()

0 comments on commit 801b0ad

Please sign in to comment.