fgen


Namefgen JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://gitlab.com/magicc/fgen
SummaryAutomatically generate wrapper to integrate Fortran and Python
upload_time2024-04-10 12:18:21
maintainerNone
docs_urlNone
authorZebedee Nicholls
requires_python<4.0,>=3.9
licenseBSD-3-Clause
keywords fortran
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fortran-Python wrapper

<!---
Can use start-after and end-before directives in docs, see
https://myst-parser.readthedocs.io/en/latest/syntax/organising_content.html#inserting-other-documents-directly-into-the-current-document
-->

<!--- sec-begin-description -->

Automatically generate wrappers to integrate Fortran and Python


This project consists of a few different components:

* fgen
* fgen_runtime
* libfgen

<!--- sec-end-description -->

Full documentation can be found at:
[fgen.readthedocs.io](https://fgen.readthedocs.io/en/latest/).
We recommend reading the docs there because the internal documentation links
don't render correctly on GitLab's viewer. TODO: Create docs

## Installation

<!--- sec-begin-installation -->

fgen can be installed with pip:

```bash
pip install fgen
```

## Usage

TODO

### libfgen

If you wish to use the fortran functionality in a downstream library, the fortran library must be compiled and
linked against. A CMake module for finding or fetching the `fgen` library is available as part of this
repository (from the repository root, see `cmake/Findfgen.cmake`). This module will try and find fgen
according a few different methods:

* cmake: Use a cmake config file (uses the cmake command `find_package(fgen CONFIG)`)
* subproject: Use a relative directory (relative to the CMake file) that points to a cloned `fgen` repository
* fetch: Download the project from GitLab and build locally

The order that the methods tried can be set using the CMake define : `FGEN_FIND_METHOD`
(default order: `["cmake" "subproject" "fetch"]`). The `Findfgen.cmake` CMake module must be accessible
from the target repository. The current recommendation is to copy `Findfgen.cmake` into the repository. This
allows the target repository to pin the specific git hash of `fgen` to use.

The library can then be integrated into a CMake project by adding the snippet below:

```cmake
if(
  NOT
  TARGET
  "fgen::fgen"
)
  # Find the fgen package, fetch it from gitlab if it isn't available locally
  find_package(
    "fgen"
    REQUIRED
  )
endif()
```

Some examples of using fgen are provided in `tests/test-data`.


<!--- sec-end-installation -->

### For developers

<!--- sec-begin-installation-dev -->

For development, we rely on [poetry](https://python-poetry.org) for all our
dependency management. To get started, you will need to make sure that poetry
is installed
([instructions here](https://python-poetry.org/docs/#installing-with-the-official-installer),
we found that pipx and pip worked better to install on a Mac).

For all of work, we use our `Makefile`.
You can read the instructions out and run the commands by hand if you wish,
but we generally discourage this because it can be error prone.
In order to create your environment, run `make virtual-environment`.

Once the virtual environment has been created, `libfgen` can be built
using `make build`. This library contains the common Fortran code used by
all wrappers and uses [CMake](https://cmake.org/) to build and requires
a working Fortran compiler.

If there are any issues, the messages from the `Makefile` should guide you
through. If not, please raise an issue in the
[issue tracker](https://gitlab.com/magicc/fgen/issues).

For the rest of our developer docs, please see [](development-reference).

<!--- sec-end-installation-dev -->

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/magicc/fgen",
    "name": "fgen",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "fortran",
    "author": "Zebedee Nicholls",
    "author_email": "zebedee.nicholls@climate-energy-college.org",
    "download_url": "https://files.pythonhosted.org/packages/fd/e7/52fe41bcf846357d16b3ad9b269b8f2c782abcbd0ff84be57f09709f18b6/fgen-0.4.1.tar.gz",
    "platform": null,
    "description": "# Fortran-Python wrapper\n\n<!---\nCan use start-after and end-before directives in docs, see\nhttps://myst-parser.readthedocs.io/en/latest/syntax/organising_content.html#inserting-other-documents-directly-into-the-current-document\n-->\n\n<!--- sec-begin-description -->\n\nAutomatically generate wrappers to integrate Fortran and Python\n\n\nThis project consists of a few different components:\n\n* fgen\n* fgen_runtime\n* libfgen\n\n<!--- sec-end-description -->\n\nFull documentation can be found at:\n[fgen.readthedocs.io](https://fgen.readthedocs.io/en/latest/).\nWe recommend reading the docs there because the internal documentation links\ndon't render correctly on GitLab's viewer. TODO: Create docs\n\n## Installation\n\n<!--- sec-begin-installation -->\n\nfgen can be installed with pip:\n\n```bash\npip install fgen\n```\n\n## Usage\n\nTODO\n\n### libfgen\n\nIf you wish to use the fortran functionality in a downstream library, the fortran library must be compiled and\nlinked against. A CMake module for finding or fetching the `fgen` library is available as part of this\nrepository (from the repository root, see `cmake/Findfgen.cmake`). This module will try and find fgen\naccording a few different methods:\n\n* cmake: Use a cmake config file (uses the cmake command `find_package(fgen CONFIG)`)\n* subproject: Use a relative directory (relative to the CMake file) that points to a cloned `fgen` repository\n* fetch: Download the project from GitLab and build locally\n\nThe order that the methods tried can be set using the CMake define : `FGEN_FIND_METHOD`\n(default order: `[\"cmake\" \"subproject\" \"fetch\"]`). The `Findfgen.cmake` CMake module must be accessible\nfrom the target repository. The current recommendation is to copy `Findfgen.cmake` into the repository. This\nallows the target repository to pin the specific git hash of `fgen` to use.\n\nThe library can then be integrated into a CMake project by adding the snippet below:\n\n```cmake\nif(\n  NOT\n  TARGET\n  \"fgen::fgen\"\n)\n  # Find the fgen package, fetch it from gitlab if it isn't available locally\n  find_package(\n    \"fgen\"\n    REQUIRED\n  )\nendif()\n```\n\nSome examples of using fgen are provided in `tests/test-data`.\n\n\n<!--- sec-end-installation -->\n\n### For developers\n\n<!--- sec-begin-installation-dev -->\n\nFor development, we rely on [poetry](https://python-poetry.org) for all our\ndependency management. To get started, you will need to make sure that poetry\nis installed\n([instructions here](https://python-poetry.org/docs/#installing-with-the-official-installer),\nwe found that pipx and pip worked better to install on a Mac).\n\nFor all of work, we use our `Makefile`.\nYou can read the instructions out and run the commands by hand if you wish,\nbut we generally discourage this because it can be error prone.\nIn order to create your environment, run `make virtual-environment`.\n\nOnce the virtual environment has been created, `libfgen` can be built\nusing `make build`. This library contains the common Fortran code used by\nall wrappers and uses [CMake](https://cmake.org/) to build and requires\na working Fortran compiler.\n\nIf there are any issues, the messages from the `Makefile` should guide you\nthrough. If not, please raise an issue in the\n[issue tracker](https://gitlab.com/magicc/fgen/issues).\n\nFor the rest of our developer docs, please see [](development-reference).\n\n<!--- sec-end-installation-dev -->\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Automatically generate wrapper to integrate Fortran and Python",
    "version": "0.4.1",
    "project_urls": {
        "Homepage": "https://gitlab.com/magicc/fgen"
    },
    "split_keywords": [
        "fortran"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b70f29dfa935fcfca1b79ff7db1ea1b2287c0b5e46e877381604321f29bca9c1",
                "md5": "61d9c601aa905605b52fe927f0030939",
                "sha256": "07c4ffc642b991a76d60cc0e96f2486c0bfad26829f5b43be0c756bc2b253c15"
            },
            "downloads": -1,
            "filename": "fgen-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "61d9c601aa905605b52fe927f0030939",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 117842,
            "upload_time": "2024-04-10T12:18:19",
            "upload_time_iso_8601": "2024-04-10T12:18:19.661160Z",
            "url": "https://files.pythonhosted.org/packages/b7/0f/29dfa935fcfca1b79ff7db1ea1b2287c0b5e46e877381604321f29bca9c1/fgen-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fde752fe41bcf846357d16b3ad9b269b8f2c782abcbd0ff84be57f09709f18b6",
                "md5": "13644b7f15ff4baef7266f6a458a35f0",
                "sha256": "0b31ab8558da514757c0107d63715d12788ab8b846fe57773a15348b27b5df5e"
            },
            "downloads": -1,
            "filename": "fgen-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "13644b7f15ff4baef7266f6a458a35f0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 69660,
            "upload_time": "2024-04-10T12:18:21",
            "upload_time_iso_8601": "2024-04-10T12:18:21.645207Z",
            "url": "https://files.pythonhosted.org/packages/fd/e7/52fe41bcf846357d16b3ad9b269b8f2c782abcbd0ff84be57f09709f18b6/fgen-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-10 12:18:21",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "magicc",
    "gitlab_project": "fgen",
    "lcname": "fgen"
}
        
Elapsed time: 0.21913s