Skip to main content

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

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

specpart-0.0.7-cp311-cp311-win_amd64.whl (3.7 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

specpart-0.0.7-cp310-cp310-win_amd64.whl (3.7 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

specpart-0.0.7-cp39-cp39-win_amd64.whl (3.7 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

specpart-0.0.7-cp38-cp38-win_amd64.whl (3.7 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page