specpart


Namespecpart JSON
Version 0.0.7 PyPI version JSON
download
home_page
Summaryspecpart module for use in wavespectra
upload_time2024-03-07 13:53:45
maintainer
docs_urlNone
author
requires_python<3.12,>=3.8
licenseMIT License Copyright (c) 2024 Ruben de Bruin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords wave spectra ocean xarray statistics analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.<br>
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

```commandline
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](https://github.com/RubendeBruin/specpart/blob/main/meson.build):
- set meson-python as build backend: [pyproject.toml](https://github.com/RubendeBruin/specpart/blob/main/pyproject.toml) 
- used Github Actions to perform the actual build on windows: [actions](https://github.com/RubendeBruin/specpart/blob/main/.github/workflows/main.yml)
 
Attention points:
- As the target machine is not the same as the build machine, the dlls need to be bundeled: see [discussion](https://github.com/mesonbuild/meson-python/discussions/595#discussioncomment-8704971)
- 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?
            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "specpart",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<3.12,>=3.8",
    "maintainer_email": "Ruben de Bruin <info@rdbr.nl>",
    "keywords": "wave spectra ocean xarray statistics analysis",
    "author": "",
    "author_email": "Wavespectra Developers <r.guedes@oceanum.science>",
    "download_url": "",
    "platform": null,
    "description": "# Specpart\n\nThis is used by the wavespectra packages (both wavespectra/wavespectra and metocean/wavespectra).\n\nThis repository is used to create pre-build binary wheels for windows.<br>\nLinux and macos are open to contributions.\n\n\n## Creation\n\nGetting this to work was a bit of a trial-and-error. The following problems were encountered:\n- not compiling, fixed by removing some of the statements from the generated .f90 file\n- not working on the target machine due to missing .dll files (Importing created package fails with ImportError: DLL load failed)\n\nThe following steps were taken with help from the community:\n\n- generated wrapper using f2py and specpart.f90 (not using pre-exising .pyf file) file\n\n```commandline\npython -m numpy.f2py specpart.f90 -m specpart\n```\n\n- manually edited the generated .f90 wrapper file, removing sections:\n```\nuse specpart, only : ptsort\nuse specpart, only : ptnghb\nuse specpart, only : pt_fld\n```\n\n- created meson build file: [meson.build](https://github.com/RubendeBruin/specpart/blob/main/meson.build):\n- set meson-python as build backend: [pyproject.toml](https://github.com/RubendeBruin/specpart/blob/main/pyproject.toml) \n- used Github Actions to perform the actual build on windows: [actions](https://github.com/RubendeBruin/specpart/blob/main/.github/workflows/main.yml)\n \nAttention points:\n- As the target machine is not the same as the build machine, the dlls need to be bundeled: see [discussion](https://github.com/mesonbuild/meson-python/discussions/595#discussioncomment-8704971)\n- use delvewheel to inspect and repair created wheels. This includes all the required .dll files in the wheel\n- delvewheel stores the repaired wheel in the /wheelhouse folder, this is uploaded as artifact.\n- download the wheel and install it using pip\n\nChecks:\n- Importing works,\n- Required functions are available:\n\n```\nPython 3.11.3 (tags/v3.11.3:f3909b8, Apr  4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import specpart\n>>> specpart.specpart.partition\n<fortran function partition>\n>>> specpart.specpart.partition()\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nTypeError: specpart.specpart.partition() missing required argument 'spec' (pos 1)\n>>> specpart.specpart.ihmax\narray(200, dtype=int32)\n>>> specpart.specpart.npart\narray(0, dtype=int32)\n>>>\n> ``````\n\n\n## Open questions\n\n- Why is devewheel required when we do static linking?\n- Why does devwheel not accept wildcards?",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Ruben de Bruin  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "specpart module for use in wavespectra",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/RubendeBruin/specpart",
        "Issues": "https://github.com/RubendeBruin/specpart/issues"
    },
    "split_keywords": [
        "wave",
        "spectra",
        "ocean",
        "xarray",
        "statistics",
        "analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5468b931cc5128f96601be24043dec48271ba65791d72ee60310c7202bcefe05",
                "md5": "a9ece89b2dbd12c49d5e0832873a5b07",
                "sha256": "7013dd53983ebf3292896089cd332a487f8d7e616e7f6351e00fbede7a229786"
            },
            "downloads": -1,
            "filename": "specpart-0.0.7-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "a9ece89b2dbd12c49d5e0832873a5b07",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": "<3.12,>=3.8",
            "size": 3724605,
            "upload_time": "2024-03-07T13:53:45",
            "upload_time_iso_8601": "2024-03-07T13:53:45.429859Z",
            "url": "https://files.pythonhosted.org/packages/54/68/b931cc5128f96601be24043dec48271ba65791d72ee60310c7202bcefe05/specpart-0.0.7-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51fe7e8ee59de4057a71b54052374469f1ce1128eaf331e4d466a496c0c62972",
                "md5": "759e4dc3ed3bd7c7a018dc6cb1ed7988",
                "sha256": "7c8e7ca227244831575166cf750f3e011918e0004f01ab77119f64b5a34d36ca"
            },
            "downloads": -1,
            "filename": "specpart-0.0.7-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "759e4dc3ed3bd7c7a018dc6cb1ed7988",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": "<3.12,>=3.8",
            "size": 3724604,
            "upload_time": "2024-03-07T13:53:48",
            "upload_time_iso_8601": "2024-03-07T13:53:48.341565Z",
            "url": "https://files.pythonhosted.org/packages/51/fe/7e8ee59de4057a71b54052374469f1ce1128eaf331e4d466a496c0c62972/specpart-0.0.7-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "043a50b486549a941411b16538dd1b01d6361a636cbb60c4d1fcb0bbef77cf62",
                "md5": "dc1c7c2f4c0bb425185ec1f210403e47",
                "sha256": "c4266a5e32411ec6ac515db6d2f4bec232c6f64257b2e6de9a3147ff6fc5dd9d"
            },
            "downloads": -1,
            "filename": "specpart-0.0.7-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "dc1c7c2f4c0bb425185ec1f210403e47",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<3.12,>=3.8",
            "size": 3725057,
            "upload_time": "2024-03-07T13:53:49",
            "upload_time_iso_8601": "2024-03-07T13:53:49.650313Z",
            "url": "https://files.pythonhosted.org/packages/04/3a/50b486549a941411b16538dd1b01d6361a636cbb60c4d1fcb0bbef77cf62/specpart-0.0.7-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9eb49d30d5bd5811e9129c815997dc06bca521c8dcae551f840ee71a2f9fe90",
                "md5": "36cc57c135da0edbe953b666feaba3df",
                "sha256": "a6810433c59b49a43e303c4fe7397f246db78a291ce0536a5e6cd508d246a1c3"
            },
            "downloads": -1,
            "filename": "specpart-0.0.7-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "36cc57c135da0edbe953b666feaba3df",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": "<3.12,>=3.8",
            "size": 3725079,
            "upload_time": "2024-03-07T13:53:52",
            "upload_time_iso_8601": "2024-03-07T13:53:52.612116Z",
            "url": "https://files.pythonhosted.org/packages/b9/eb/49d30d5bd5811e9129c815997dc06bca521c8dcae551f840ee71a2f9fe90/specpart-0.0.7-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-07 13:53:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RubendeBruin",
    "github_project": "specpart",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "specpart"
}
        
Elapsed time: 0.19777s