Skip to content

Commit

Permalink
Merge branch 'release/v0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
t-sommer committed Apr 20, 2021
2 parents 216bd08 + 385436c commit 439e0ea
Show file tree
Hide file tree
Showing 33 changed files with 903 additions and 701 deletions.
96 changes: 31 additions & 65 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,32 @@
variables:
- name: create_environment
value: conda create --yes --quiet --name py37 -c conda-forge python=3.7 dask ipython=7 lark-parser lxml matplotlib notebook numpy plotly pyqt pyqtgraph pytest-cov requests scipy

jobs:

- job: linux
displayName: 'Ubuntu 16.04'
strategy:
matrix:
python27:
python.version: '2.7'
python.libraries: 'pathlib'
python37:
python.version: '3.7'
python.libraries: 'ipython=7 notebook'
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- bash: conda create --yes --quiet --name myEnvironment
- bash: $(create_environment) cmake
displayName: Create Anaconda environment

- bash: |
source activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=$PYTHON_VERSION cmake dask lark-parser lxml matplotlib numpy plotly pyqt pyqtgraph pytest-cov requests scipy $PYTHON_LIBRARIES
displayName: Install Anaconda packages
- bash: |
source activate myEnvironment
source activate py37
python build_cvode.py
displayName: Build CVode binaries
- bash: |
source activate myEnvironment
source activate py37
python build_fmucontainer.py
displayName: Build FMU Container
- bash: |
source activate myEnvironment
source activate py37
python setup.py bdist_wheel --universal
for f in dist/FMPy-*.whl; do
pip install $f --no-deps -vv
Expand All @@ -49,7 +40,7 @@ jobs:
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
testRunTitle: 'Publish test results'

- task: PublishCodeCoverageResults@1
inputs:
Expand All @@ -60,18 +51,10 @@ jobs:
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'linux-python-$(python.version)'
artifact: 'linux'

- job: macosx
displayName: 'macOS 10.15'
strategy:
matrix:
python27:
python.version: '2.7'
python.libraries: 'pathlib'
python38:
python.version: '3.7'
python.libraries: 'ipython=7 notebook'
pool:
vmImage: 'macos-10.15'

Expand All @@ -85,26 +68,21 @@ jobs:
- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation

- bash: conda create --yes --quiet --name myEnvironment
- bash: $(create_environment)
displayName: Create Anaconda environment

- bash: |
source activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=$PYTHON_VERSION dask lark-parser lxml matplotlib numpy plotly pyqt pyqtgraph pytest-cov requests scipy $PYTHON_LIBRARIES
displayName: Install Anaconda packages
- bash: |
source activate myEnvironment
source activate py37
python build_cvode.py
displayName: Build CVode binaries
- bash: |
source activate myEnvironment
source activate py37
python build_fmucontainer.py
displayName: Build FMU Container
- bash: |
source activate myEnvironment
source activate py37
python setup.py bdist_wheel --universal
for f in dist/FMPy-*.whl; do
pip install $f --no-deps -vv
Expand All @@ -118,7 +96,7 @@ jobs:
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
testRunTitle: 'Publish test results'

- task: PublishCodeCoverageResults@1
inputs:
Expand All @@ -129,17 +107,10 @@ jobs:
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'macosx-python-$(python.version)'
artifact: 'macosx'

- job: windows
displayName: 'Windows 2016'
strategy:
matrix:
# lxml broken for Python 2.7
# python27:
# python.version: '2.7'
python37:
python.version: '3.7'
pool:
vmImage: 'vs2017-win2016'

Expand All @@ -148,41 +119,36 @@ jobs:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH

- script: conda create --yes --quiet --name myEnvironment
- script: $(create_environment) cmake pywin32
displayName: Create Anaconda environment

- script: |
call activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=%PYTHON_VERSION% cmake dask ipython=7 lark-parser lxml matplotlib notebook numpy plotly pyqt pyqtgraph pytest-cov pywin32 requests scipy
displayName: Install Anaconda packages

- script: |
call activate myEnvironment
call activate py37
python build_cvode.py
displayName: Build CVode binaries
- bash: |
source activate myEnvironment
- script: |
call activate py37
python build_fmucontainer.py
displayName: Build FMU Container
- script: |
call activate myEnvironment
call activate py37
python build_remoting.py
displayName: Build Remoting binaries
- script: |
call activate myEnvironment
call activate py37
python setup.py bdist_wheel --universal
displayName: Build wheel
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'windows-python-$(python.version)'
artifact: 'windows'

- script: |
call activate myEnvironment
call activate py37
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
Expand All @@ -193,7 +159,7 @@ jobs:
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
testRunTitle: 'Publish test results'
failTaskOnFailedTests: true

- task: PublishCodeCoverageResults@1
Expand All @@ -218,28 +184,28 @@ jobs:

- task: DownloadPipelineArtifact@2
inputs:
artifact: linux-python-3.7
artifact: linux
downloadPath: linux

- task: DownloadPipelineArtifact@2
inputs:
artifact: macosx-python-3.7
artifact: macosx
downloadPath: macosx

- task: DownloadPipelineArtifact@2
inputs:
artifact: windows-python-3.7
artifact: windows
downloadPath: windows

- bash: |
unzip -o linux/*.whl -d merged
unzip -o macosx/*.whl -d merged
unzip -o windows/*.whl -d merged
cd merged
zip -r FMPy-x.x.x-py2.py3-none-any.whl .
displayName: Merge FMUs
zip -r FMPy-x.x.x-py3-none-any.whl .
displayName: Merge Python Wheels
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: merged/FMPy-x.x.x-py2.py3-none-any.whl
pathtoPublish: merged/FMPy-x.x.x-py3-none-any.whl
artifactName: merged
2 changes: 1 addition & 1 deletion build_cvode.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if os.path.isdir(build_dir):
shutil.rmtree(build_dir)

url = 'https://computing.llnl.gov/projects/sundials/download/sundials-5.3.0.tar.gz'
url = 'https://github.com/LLNL/sundials/releases/download/v5.3.0/sundials-5.3.0.tar.gz'
checksum = '88dff7e11a366853d8afd5de05bf197a8129a804d9d4461fb64297f1ef89bca7'

filename = os.path.basename(url)
Expand Down
14 changes: 14 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## v0.3.0 (2021-04-20)

This release drops Python 2.7 support. The minimum required version is now Python 3.5.

### Enhancements

- Update API to FMI 3.0-beta.1
- Add type hints to Model Description and simulate_fmu()
- Add "Hide All" and fix "Show All" columns in GUI
- Add target_platform parameter to compile_platform_binary()
- Link against libm when compiling platform binaries on Linux (#242)
- Add parameter set_input_derivatives to Input and simulate_fmu() (#240)
- Escape non-ASCII characters in XML attributes (#216)

## v0.2.27 (2021-01-28)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion docs/hacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ conda create -q -n py36_64 -c anaconda python=3.6 dask lxml matplotlib numpy pyq
```

on Linux and macOS the `pywin32` package is not required but you might need to prepend `sudo` to
the command depending on your permissions. If you want Python 2.7 you can use `python=2.7`.
the command depending on your permissions.
If you want a 32-bit Python environment you have to enter `set CONDA_FORCE_32BIT=1` before creating
the environment. Note that in order to simulate FMUs the Python environment has to match the
platforms supported by the FMU. I.e. you need a 64-bit Python on Windows to simulate an FMU that
Expand Down
6 changes: 2 additions & 4 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.27'
__version__ = '0.3.0'

# experimental
plot_library = 'matplotlib' # 'plotly'
Expand Down Expand Up @@ -71,10 +71,8 @@ def supported_platforms(filename):
platforms a list of supported platforms supported by the FMU
"""

from .util import _is_string

# get the files within the FMU
if _is_string(filename) and os.path.isdir(filename): # extracted FMU
if isinstance(filename, str) and os.path.isdir(filename): # extracted FMU
names = []
for dirpath, _, filenames in os.walk(filename):
for name in filenames:
Expand Down
Loading

0 comments on commit 439e0ea

Please sign in to comment.