specpart module for use in wavespectra
Project description
Specpart
This is used by the wavespectra packages (both wavespectra/wavespectra and metocean/wavespectra).
This repository is used to create pre-build binary wheels for windows.
Linux and macos are open to contributions.
Creation
Getting this to work was a bit of a trial-and-error. The following problems were encountered:
- not compiling, fixed by removing some of the statements from the generated .f90 file
- not working on the target machine due to missing .dll files (Importing created package fails with ImportError: DLL load failed)
The following steps were taken with help from the community:
- generated wrapper using f2py and specpart.f90 (not using pre-exising .pyf file) file
python -m numpy.f2py specpart.f90 -m specpart
- manually edited the generated .f90 wrapper file, removing sections:
use specpart, only : ptsort
use specpart, only : ptnghb
use specpart, only : pt_fld
- created meson build file: meson.build:
- set meson-python as build backend: pyproject.toml
- used Github Actions to perform the actual build on windows: actions
Attention points:
- As the target machine is not the same as the build machine, the dlls need to be bundeled: see discussion
- use delvewheel to inspect and repair created wheels. This includes all the required .dll files in the wheel
- delvewheel stores the repaired wheel in the /wheelhouse folder, this is uploaded as artifact.
- download the wheel and install it using pip
Checks:
- Importing works,
- Required functions are available:
Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import specpart
>>> specpart.specpart.partition
<fortran function partition>
>>> specpart.specpart.partition()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: specpart.specpart.partition() missing required argument 'spec' (pos 1)
>>> specpart.specpart.ihmax
array(200, dtype=int32)
>>> specpart.specpart.npart
array(0, dtype=int32)
>>>
> ``````
## Open questions
- Why is devewheel required when we do static linking?
- Why does devwheel not accept wildcards?
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for specpart-0.0.7-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c8e7ca227244831575166cf750f3e011918e0004f01ab77119f64b5a34d36ca |
|
MD5 | 759e4dc3ed3bd7c7a018dc6cb1ed7988 |
|
BLAKE2b-256 | 51fe7e8ee59de4057a71b54052374469f1ce1128eaf331e4d466a496c0c62972 |
Close
Hashes for specpart-0.0.7-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7013dd53983ebf3292896089cd332a487f8d7e616e7f6351e00fbede7a229786 |
|
MD5 | a9ece89b2dbd12c49d5e0832873a5b07 |
|
BLAKE2b-256 | 5468b931cc5128f96601be24043dec48271ba65791d72ee60310c7202bcefe05 |
Close
Hashes for specpart-0.0.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6810433c59b49a43e303c4fe7397f246db78a291ce0536a5e6cd508d246a1c3 |
|
MD5 | 36cc57c135da0edbe953b666feaba3df |
|
BLAKE2b-256 | b9eb49d30d5bd5811e9129c815997dc06bca521c8dcae551f840ee71a2f9fe90 |
Close
Hashes for specpart-0.0.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4266a5e32411ec6ac515db6d2f4bec232c6f64257b2e6de9a3147ff6fc5dd9d |
|
MD5 | dc1c7c2f4c0bb425185ec1f210403e47 |
|
BLAKE2b-256 | 043a50b486549a941411b16538dd1b01d6361a636cbb60c4d1fcb0bbef77cf62 |