Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
more rebase fixes

more rebase cleanup

more rebase cleanup

Removing tests as module; moved test files to tests/files

moved test_util to pyfmi/src

Adding pytest config

fixed example path

replaced tests conditional to Assimulo installation by markers

simplified workflow file; added changelog
  • Loading branch information
Peter Meisrimel authored and Peter Meisrimel committed Nov 14, 2024
1 parent 3d6bf28 commit dcd393f
Show file tree
Hide file tree
Showing 70 changed files with 1,025 additions and 1,062 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,4 @@ jobs:
- name: Build
run: python3 setup.py install --user --fmil-home=/usr
- name: Test
run: |
rm src/pyfmi/__init__.py
cp -rv src/pyfmi/tests/files tests
pytest --verbose tests/
run: pytest
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
* Added option to limit the size of the result ("result_max_size"), default set to 2GB.
* Added method ResultDymolaBinary.get_variables_data. Included some minor refactorization.
The new method allows for retrieving partial trajectories, and multiple trajectories at once.
* Changed testing framework from `nose` to `pytest`.
* Removed tests from the PyFMI installation.
* Moved test files from src/pyfmi/tests/... to tests/files/...
* Moved test_util.* from src/pyfmi/tests to src/pyfmi

--- PyFMI-2.14.0 ---
* Updated the error message displayed when loading FMUs with needsExecutionTool set to True.
Expand Down
4 changes: 4 additions & 0 deletions tests/pytest.ini → pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[pytest]
testpaths =
tests
filterwarnings =
ignore:.*does not support directional derivatives.*:UserWarning
markers =
assimulo
17 changes: 5 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def check_extensions():
compiler_directives={'language_level' : "3str"})

# Test utilities
ext_list += cythonize([os.path.join("src", "pyfmi", "tests", "test_util.pyx")],
ext_list += cythonize([os.path.join("src", "pyfmi", "test_util.pyx")],
include_path = incl_path,
compiler_directives={'language_level' : "3str"})

Expand Down Expand Up @@ -324,33 +324,26 @@ def check_extensions():
classifiers=CLASSIFIERS,
ext_modules = ext_list,
package_dir = {'pyfmi': os.path.join('src', 'pyfmi'),
'pyfmi.common': os.path.join('src', 'common'),
'pyfmi.tests': 'tests'},
'pyfmi.common': os.path.join('src', 'common')
},
packages=[
'pyfmi',
'pyfmi.simulation',
'pyfmi.examples',
'pyfmi.common',
'pyfmi.common.plotting',
'pyfmi.tests',
'pyfmi.common.log'
],
package_data = {'pyfmi': [
'examples/files/FMUs/ME1.0/*',
'examples/files/FMUs/CS1.0/*',
'examples/files/FMUs/ME2.0/*',
'examples/files/FMUs/CS2.0/*',
'tests/files/FMUs/XML/ME1.0/*',
'tests/files/FMUs/XML/CS1.0/*',
'tests/files/FMUs/XML/ME2.0/*',
'tests/files/FMUs/XML/CS2.0/*',
'tests/files/Results/*',
'tests/files/Logs/*',
'version.txt',
'LICENSE',
'CHANGELOG',
'util/*'] + extra_package_data,
'pyfmi.tests': ['pytest.ini']},
'util/*'] + extra_package_data
},
script_args=copy_args
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pyfmi/tests/test_util.pyx → src/pyfmi/test_util.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cimport pyfmi.fmil_import as FMIL
from pyfmi.fmi import FMUException, FMUModelME1, FMUModelCS1, FMUModelCS2, FMUModelME2

def get_examples_folder():
return os.path.join(os.path.dirname(__file__), '..', 'examples')
return os.path.join(os.path.dirname(__file__), 'examples')

cdef class _ForTestingFMUModelME1(FMUModelME1):
cdef int _get_nominal_continuous_states_fmil(self, FMIL.fmi1_real_t* xnominal, size_t nx):
Expand Down
16 changes: 0 additions & 16 deletions src/pyfmi/tests/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions tests/__init__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit dcd393f

Please sign in to comment.