Skip to content

Commit

Permalink
Merge branch 'release/v0.2.20'
Browse files Browse the repository at this point in the history
  • Loading branch information
t-sommer committed May 22, 2020
2 parents d6f042a + a66292e commit 3841175
Show file tree
Hide file tree
Showing 55 changed files with 2,946 additions and 924 deletions.
8 changes: 3 additions & 5 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FMPy
====

Copyright (c) 2017-2018 Dassault Systemes. All rights reserved.
FMPy is released under the 2-Clause BSD license:

Copyright (c) 2017-2020 Dassault Systemes. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand All @@ -14,10 +16,6 @@ modification, are permitted provided that the following conditions are met:
in the documentation and/or other materials provided with the
distribution.

* Neither the name Dassault Systemes nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ Please send an e-mail to support@ltx.de for a quote.

------------------------------------

© 2018 Dassault Systèmes
© 2020 Dassault Systèmes
25 changes: 15 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ jobs:
matrix:
python27:
python.version: '2.7'
python.libraries: 'pathlib'
python36:
python.version: '3.6'
python.libraries: ''
pool:
vmImage: 'ubuntu-16.04'
steps:
Expand All @@ -19,7 +21,7 @@ jobs:

- bash: |
source activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=$PYTHON_VERSION cmake dask lark-parser lxml matplotlib numpy pathlib pyqt pyqtgraph pytest-cov requests
conda install --yes --quiet --name myEnvironment -c conda-forge python=$PYTHON_VERSION cmake dask lark-parser lxml matplotlib numpy pyqt pyqtgraph pytest-cov requests $PYTHON_LIBRARIES
displayName: Install Anaconda packages
- bash: |
Expand All @@ -29,7 +31,7 @@ jobs:
pip install $f --no-deps -vv
done
cd tests
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml --cov-report=html
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml
cd ..
displayName: Build, install and run tests
Expand All @@ -51,15 +53,17 @@ jobs:
artifact: 'linux-python-$(python.version)'

- job:
displayName: 'macOS 10.13'
displayName: 'macOS 10.15'
strategy:
matrix:
python27:
python.version: '2.7'
python.libraries: 'pathlib'
python36:
python.version: '3.6'
python.libraries: ''
pool:
vmImage: 'macos-10.13'
vmImage: 'macos-10.15'

steps:

Expand All @@ -76,7 +80,7 @@ jobs:

- bash: |
source activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=$PYTHON_VERSION dask lark-parser lxml matplotlib numpy pathlib pyqt pyqtgraph pytest-cov requests
conda install --yes --quiet --name myEnvironment -c conda-forge python=$PYTHON_VERSION dask lark-parser lxml matplotlib numpy pyqt pyqtgraph pytest-cov requests $PYTHON_LIBRARIES
displayName: Install Anaconda packages
- bash: |
Expand All @@ -86,7 +90,7 @@ jobs:
pip install $f --no-deps -vv
done
cd tests
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml --cov-report=html
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml
cd ..
displayName: Build, install and run tests
Expand All @@ -111,8 +115,9 @@ jobs:
displayName: 'Windows 2016'
strategy:
matrix:
python27:
python.version: '2.7'
# lxml broken for Python 2.7
# python27:
# python.version: '2.7'
python36:
python.version: '3.6'
pool:
Expand All @@ -128,7 +133,7 @@ jobs:

- script: |
call activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=%PYTHON_VERSION% cmake dask lark-parser lxml matplotlib numpy pathlib pyqt pyqtgraph pytest-cov pywin32 requests
conda install --yes --quiet --name myEnvironment -c conda-forge python=%PYTHON_VERSION% cmake dask lark-parser lxml matplotlib numpy pyqt pyqtgraph pytest-cov pywin32 requests
displayName: Install Anaconda packages
- script: |
Expand All @@ -145,7 +150,7 @@ jobs:
call activate myEnvironment
for %%f in (dist\FMPy-*.whl) do pip install %%f --no-deps
cd tests
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml --cov-report=html
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml
cd ..
displayName: Install wheel and run tests
Expand Down
36 changes: 36 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## v0.2.20 (2020-05-23)

- `FIXED` Fix fmi3Functions.h for compile_platform_binary()
- `FIXED` Fix serialization in write_csv() (#138)
- `FIXED` Check for existing documentation/licenses in add_remoting() (#126)
- `FIXED` Fix function names in RPC calls (#125)
- `CHANGED` Require pathlib only for Python version < 3.4
- `NEW` Update FMI 3 API to a51b173
- `NEW` Use defaultExperiment.tolerance as default in GUI (#133)
- `NEW` Add "Tools" menu to GUI (#124)
- `NEW` Make build configuration adjustable in build_remoting.py

## v0.2.19 (2020-04-15)

- `FIXED` fmi2SetupExperiment() is now called again in FMI 2.0 for Co-Simulation
- `FIXED` The working directory for the remoting server is now set to binaries/win32
- `FIXED` ssp.simulation.set_value() has been fixed for Integer and Enumeration variables
- `NEW` A license file is now added to documentation/licenses when adding the remoting binaries to an FMU
- `NEW` A stop_time parameter has been added to ssp.instantiate_fmu()
- `CHANGED` The license has been changed to 2-clause BSD

## v0.2.18 (2020-04-06)

- `FIXED` A list is now passed to np.stack() instead of an iterable and Iterable is now imported from collections.abc to avoid FutureWarnings.
- `FIXED` Argument checksum of function fmpy.util.download_file() can now be upper case.
- `FIXED` Start and stop time are now passed to initialize() in FMI 1.0.
- `FIXED` Variadic arguments in log messages are now processed.
- `NEW` The model.png is now displayed on the "Model Info" page of the GUI.
- `NEW` 32-bit FMUs can now be simulated in a 64-bit Python environment on Windows.
Existing 32-bit FMUs can also be retro-fitted using the function fmpy.util.add_remoting(),
the CLI (fmpy add-remoting ...) and the GUI (Help > Add 32-bit Remoting).
- `NEW` The FMI headers and schema have been updated to version 2.0.1 and 3.0-alpha.3 respectively.
- `NEW` The function instantiate_fmu() allows the instantiation and re-use of an FMU independent of the FMI version and type to reduce CPU time.
See `examples/efficient_loops.py` for an example.
- `REMOVED` The parameter `use_source_code` has been removed form `simulate_fmu()` (use `fmpy.util.compile_platform_binary()` instead)

## v0.2.17 (2020-02-04)

- `NEW` "Clear Plots" action has been added to the context menu
Expand Down
12 changes: 9 additions & 3 deletions docs/hacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and Python.
To create a new conda environment named "py36_64" enter

```bash
conda create -q -n py36_64 -c anaconda python=3.6 dask lxml matplotlib numpy pathlib pyqt pyqtgraph pywin32 requests
conda create -q -n py36_64 -c anaconda python=3.6 dask lxml matplotlib numpy pyqt pyqtgraph pywin32 requests
```

on Linux and macOS the `pywin32` package is not required but you might need to prepend `sudo` to
Expand All @@ -28,13 +28,13 @@ only supports `win64`. To activate the environment run `activate py36_64` on Win
If you want to use an existing Python you can install the necessary dependencies with conda

```bash
conda install dask lxml matplotlib numpy pathlib pyqt pyqtgraph pywin32 requests
conda install dask lxml matplotlib numpy pyqt pyqtgraph pywin32 requests
```

or pip

```bash
python -m pip install dask lxml matplotlib numpy pathlib pyqt pyqtgraph pywin32 requests
python -m pip install dask lxml matplotlib numpy pyqt pyqtgraph pywin32 requests
```

The package `pywin32` is only required on Windows.
Expand Down Expand Up @@ -64,6 +64,12 @@ To install or update FMPy without changing the dependencies of your python envir
python -m pip install --upgrade --no-deps .
```

To use the sources directly, install FMPy in [develop mode](https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-e) using the `--editable` option

```bash
python -m pip install --no-deps --editable .
```

## Create a PyCharm project

Download and install [PyCharm Community Edition](https://www.jetbrains.com/pycharm/download/). On the welcome screen click `Create New Project` or select `File > New Project...`.
Expand Down
20 changes: 8 additions & 12 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ to install your packages individually you can use [Miniconda](https://conda.io/m

Depending on what you intent to use FMPy for you might only need certain packages.

| Function | Required packages |
|---------------------------|-------------------------------------------|
| Read modelDescription.xml | lxml |
| Simulate FMUs | numpy, pathlib, pywin32 (only on Windows) |
| Plot results | matplotlib |
| Parallelization example | dask |
| Download example FMUs | requests |
| Graphical user interface | pyqt, pyqtgraph |

| Function | Required packages |
|---------------------------|----------------------------------|
| Read modelDescription.xml | lxml |
| Simulate FMUs | numpy, pywin32 (only on Windows) |
| Plot results | matplotlib |
| Parallelization example | dask |
| Download example FMUs | requests |
| Graphical user interface | pyqt, pyqtgraph |

## Install with Conda

Expand All @@ -38,7 +37,6 @@ and install the dependencies with
conda install <packages>
```


## Install with PIP

To install FMPy from [PyPI](https://pypi.python.org/pypi) including all dependencies type
Expand All @@ -59,7 +57,6 @@ and install the dependencies with
python -m pip install <packages>
```


## Install from Source

To install the latest development version directly from GitHub type
Expand All @@ -68,7 +65,6 @@ To install the latest development version directly from GitHub type
python -m pip install https://github.com/CATIA-Systems/FMPy/archive/develop.zip
```


## Installation without an Internet Connection

If you don't have access to the internet or you're behind a firewall and cannot access [PyPI.org](https://pypi.org/) or [Anaconda Cloud](https://anaconda.org/) directly you can download and copy the following files to the target machine:
Expand Down
4 changes: 2 additions & 2 deletions fmpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ctypes import *
import _ctypes

__version__ = '0.2.17'
__version__ = '0.2.20'


# determine the platform
Expand Down Expand Up @@ -216,5 +216,5 @@ def dump(filename):

# make the functions available in the fmpy module
from .model_description import read_model_description
from .simulation import simulate_fmu
from .simulation import simulate_fmu, instantiate_fmu
from .util import plot_result, read_csv, write_csv
Loading

0 comments on commit 3841175

Please sign in to comment.