Skip to content

Commit 7fcd6aa

Browse files
committed
Python project renamed pyrfc -> rfcnt
1 parent 29680dd commit 7fcd6aa

File tree

14 files changed

+59
-33
lines changed

14 files changed

+59
-33
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ rainflow\.sublime-workspace
66
/python/build
77
/python/venv
88
/python/dist
9-
/python/pyrfc*
9+
/python/rfcnt*
1010
/python/MANIFEST
1111
/src/config.h

python/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project(pyrfc)
1+
project(rfcnt)
22

33
# Find Python 3
44
find_package(Python3 COMPONENTS Interpreter Development)
@@ -13,6 +13,6 @@ if(NUMPY_NOT_FOUND)
1313
message(FATAL_ERROR "NumPy headers not found")
1414
endif()
1515

16-
add_library(pyrfc SHARED pyrfc.cpp)
17-
target_include_directories(pyrfc PRIVATE ${_Python3_INCLUDE_DIR})
18-
target_link_libraries(pyrfc PRIVATE ${_Python3_LIBRARY_RELEASE})
16+
add_library(rfcnt SHARED rfcnt.cpp)
17+
target_include_directories(rfcnt PRIVATE ${_Python3_INCLUDE_DIR})
18+
target_link_libraries(rfcnt PRIVATE ${_Python3_LIBRARY_RELEASE})

python/LICENSE

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
BSD 2-Clause License
2+
3+
Copyright (c) 2019, Andreas Martin
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

python/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include src/rainflow.c
22
include src/rainflow.h
33
include src/rainflow.hpp
4+
LICENSE

python/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## **pyrfc** a rainflow counting algorithm Python package
1+
## **rfcnt** a rainflow counting algorithm Python package
22

33
### "Rainflow Counting" consists of four main steps:
44

@@ -22,13 +22,13 @@ To take the residue into account, you may implement a custom method or use some
2222
predefined functions.
2323

2424
### Install
25-
pip install _{packagename}_.tar.gz
25+
pip install {packagename}.tar.gz
2626
where _{packagename}_ is the current package release, for example:
2727

28-
pip install pyrfc-0.1.0.tar.gz
28+
pip install rfcnt-0.1.0.tar.gz
2929

3030
### Test
31-
_pyrfc_ packages include some unit tests, which can be run:
31+
_rfcnt_ packages include some unit tests, which can be run:
3232

3333
python run_tests.py
3434

python/run_examples.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import sys
2-
from pyrfc.test import examples
2+
from rfcnt.tests import examples
33

44
print( "Running example 1..." )
55
examples.example_1()
66

77

88
"""
99
Jupyter Notebook:
10-
!pip install ./pyrfc-0.1.0.tar.gz
10+
!pip install ./rfcnt-0.1.0.tar.gz
1111
!pip install --upgrade matplotlib
12-
from pyrfc.test import examples
12+
from rfcnt.tests import examples
1313
examples.example_1()
1414
"""

python/run_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from pyrfc.test import test
1+
from rfcnt.tests import test_rfcnt
22
from unittest.case import TestCase
33
import unittest
44
from io import StringIO
55
from pprint import pprint
66

77
stream = StringIO()
88
runner = unittest.TextTestRunner(stream=stream)
9-
result = runner.run(unittest.makeSuite(test.TestRainflowCounting))
9+
result = runner.run(unittest.makeSuite(test_rfcnt.TestRainflowCounting))
1010
print( 'Tests run ', result.testsRun )
1111
print( 'Errors ', result.errors )
1212
pprint(result.failures)

python/setup.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def main():
1313
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
1414
long_description = f.read()
1515

16-
setup(name="pyrfc",
16+
setup(name="rfcnt",
1717
version="%d.%d.%d" % version,
1818
description="Python interface for rainflow counting",
1919
long_description=long_description,
@@ -23,12 +23,12 @@ def main():
2323
license='BSD-2-Clause License',
2424
url='http://github.com/AndreasMartin72/rainflow',
2525
install_requires=['numpy'],
26-
py_modules=["pyrfc.utils", "pyrfc.examples"],
27-
packages=["pyrfc", "pyrfc.test"],
28-
package_dir={"pyrfc": "", "pyrfc.test": "test"},
29-
package_data={"pyrfc": ["run_examples.py", "run_tests.py", "requirements.txt", "README.md"],
30-
"pyrfc.test": ["long_series.csv"]},
31-
ext_modules=[Extension("pyrfc.pyrfc", ["src/pyrfc.cpp", "src/rainflow.c"],
26+
py_modules=["rfcnt.utils", "rfcnt.examples"],
27+
packages=["rfcnt", "rfcnt.tests"],
28+
package_dir={"rfcnt": "", "rfcnt.tests": "tests"},
29+
package_data={"rfcnt": ["run_examples.py", "run_tests.py", "requirements.txt", "README.md", "LICENSE"],
30+
"rfcnt.tests": ["long_series.csv"]},
31+
ext_modules=[Extension("rfcnt.rfcnt", ["src/rfcnt.cpp", "src/rainflow.c"],
3232
define_macros=[
3333
('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION'),
3434
('RFC_HAVE_CONFIG_H', '0'),
@@ -62,7 +62,7 @@ def main():
6262
'Operating System :: MacOS :: MacOS X',
6363
'Operating System :: Microsoft :: Windows',
6464
'Operating System :: POSIX',
65-
'Programming Language :: Python : 3',
65+
'Programming Language :: Python :: 3',
6666
'Programming Language :: C++',
6767
'Programming Language :: C',
6868
'Topic :: Scientific/Engineering',

python/src/pyrfc.cpp renamed to python/src/rfcnt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ PyMethodDef method_table[] = {
420420
// A struct contains the definition of a module
421421
PyModuleDef mymath_module = {
422422
PyModuleDef_HEAD_INIT,
423-
"pyrfc", // Module name
423+
"rfcnt", // Module name
424424
"Rainflow counting module",
425425
-1, // Optional size of the module state memory
426426
method_table,
@@ -432,7 +432,7 @@ PyModuleDef mymath_module = {
432432

433433

434434
// The module init function
435-
PyMODINIT_FUNC PyInit_pyrfc(void) {
435+
PyMODINIT_FUNC PyInit_rfcnt(void) {
436436
PyObject* mod = PyModule_Create(&mymath_module);
437437
// Initialize numpy
438438
import_array();
File renamed without changes.
File renamed without changes.

python/test/examples.py renamed to python/tests/examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pandas as pd
33
import matplotlib.pyplot as plt
44
import seaborn as sns
5-
from pyrfc import pyrfc, utils # Rainflow module (ftc2)
5+
from rfcnt import rfcnt, utils # Rainflow module (ftc2)
66
import os
77
import sys
88

@@ -18,7 +18,7 @@ def example_1():
1818
class_width = class_range / (class_count - 1)
1919
class_offset = data.min() - class_width / 2
2020

21-
res = pyrfc.rfc(data, class_count=class_count,
21+
res = rfcnt.rfc(data, class_count=class_count,
2222
class_offset=class_offset,
2323
class_width=class_width,
2424
hysteresis=class_width,
File renamed without changes.

python/test/test.py renamed to python/tests/test_rfcnt.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import unittest
3-
from pyrfc import pyrfc
3+
from rfcnt import rfcnt
44
import numpy as np
55
import pandas as pd
66

@@ -37,7 +37,7 @@ def test_empty_series( self ):
3737
residual_method = 0 # No processing on residue
3838
spread_damage = 0 # No damage spreading
3939

40-
res = pyrfc.rfc( x, class_count=class_count,
40+
res = rfcnt.rfc( x, class_count=class_count,
4141
class_width=class_width,
4242
class_offset=class_offset,
4343
hysteresis=hysteresis,
@@ -64,7 +64,7 @@ def test_single_cycle_up( self ):
6464
residual_method = 0 # No processing on residue
6565
spread_damage = 0 # No damage spreading
6666

67-
res = pyrfc.rfc( x, class_count=class_count,
67+
res = rfcnt.rfc( x, class_count=class_count,
6868
class_width=class_width,
6969
class_offset=class_offset,
7070
hysteresis=hysteresis,
@@ -92,7 +92,7 @@ def test_one_cycle_down( self ):
9292
residual_method = 0 # No processing on residue
9393
spread_damage = 0 # No damage spreading
9494

95-
res = pyrfc.rfc( x, class_count=class_count,
95+
res = rfcnt.rfc( x, class_count=class_count,
9696
class_width=class_width,
9797
class_offset=class_offset,
9898
hysteresis=hysteresis,
@@ -120,7 +120,7 @@ def test_small_sample( self ):
120120
residual_method = 0 # No processing on residue
121121
spread_damage = 0 # No damage spreading
122122

123-
res = pyrfc.rfc( x, class_count=class_count,
123+
res = rfcnt.rfc( x, class_count=class_count,
124124
class_width=class_width,
125125
class_offset=class_offset,
126126
hysteresis=hysteresis,
@@ -153,7 +153,7 @@ def test_long_series( self ):
153153
residual_method = 0 # 0=RFC_RES_NONE, 7=RFC_RES_REPEATED
154154
spread_damage = 1 # 0=RFC_SD_HALF_23, 1=RFC_SD_RAMP_AMPLITUDE_23
155155

156-
res = pyrfc.rfc( x, class_count=class_count,
156+
res = rfcnt.rfc( x, class_count=class_count,
157157
class_width=class_width,
158158
class_offset=class_offset,
159159
hysteresis=hysteresis,
@@ -169,7 +169,7 @@ def test_long_series( self ):
169169

170170
spread_damage = 8; # 7=RFC_SD_TRANSIENT_23, 8=RFC_SD_TRANSIENT_23c
171171

172-
res = pyrfc.rfc( x, class_count=class_count,
172+
res = rfcnt.rfc( x, class_count=class_count,
173173
class_width=class_width,
174174
class_offset=class_offset,
175175
hysteresis=hysteresis,

0 commit comments

Comments
 (0)