6s-bin


Name6s-bin JSON
Version 0.11.3 PyPI version JSON
download
home_pagehttps://github.com/brianschubert/6s-bin
SummaryCompiled binaries for the 6S Radiative Transfer Model exposed as package resources.
upload_time2024-01-15 15:41:50
maintainer
docs_urlNone
authorBrian Schubert
requires_python>=3.9,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 6S Binaries

[![release workflow](https://github.com/brianschubert/6s-bin/actions/workflows/release.yaml/badge.svg?event=push)](https://github.com/brianschubert/6s-bin/actions/workflows/release.yaml)
[![tests workflow](https://github.com/brianschubert/6s-bin/actions/workflows/test.yaml/badge.svg)](https://github.com/brianschubert/6s-bin/actions/workflows/test.yaml)
[![PyPI - Version](https://img.shields.io/pypi/v/6s-bin)](https://pypi.org/project/6s-bin)
[![GitHub last commit (branch)](https://img.shields.io/github/last-commit/brianschubert/6s-bin/develop)](https://github.com/brianschubert/6s-bin/commits/develop)
[![License](https://img.shields.io/github/license/brianschubert/6s-bin)](./LICENSE)
[![Code style: black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/psf/black)

This distribution provides access to compiled binaries of the [6S Radiative Transfer Model](https://salsa.umd.edu/6spage.html) as [package resources](https://docs.python.org/3/library/importlib.resources.html#module-importlib.resources).

It *does not* provide a Python interface to 6S. For a Python interface, see  Robin Wilson's [Py6S].

Currently, this project includes binaries for 6SV1.1 and 6SV2.1. It requires Python 3.9+ and supports Linux, macOS, and Windows.

## Install

Pre-compiled wheels can be installed from [PyPI](https://pypi.org/project/6s-bin/):
```shell
$ pip install 6s-bin
```
If you are using [poetry](https://python-poetry.org/), you can add this distribution as a dependency using 
`poetry add`:
```shell
$ poetry add 6s-bin
```

### Installing from source

Building this distribution involves downloading, validating, and compiling the 6S source code. See [`build.py`](./build.py) for details about the build process. A Fortran 77 compiler is required to compile 6S.

Build and install from source distribution:
```shell
$ pip install --no-binary=6s-bin 6s-bin
```

Build and install from git:
```shell
$ pip install '6s-bin @ git+https://github.com/brianschubert/6s-bin'
```

Build and install from local source tree:
```shell
$ pip install .
```

## Python Usage

Call `sixs_bin.get_path(version)` to get the path to an installed 6S binary. The parameter `version` is required, and must be either the string `"1.1"` or `"2.1"`.
```pycon
>>> import sixs_bin

>>> sixs_bin.get_path("1.1")
PosixPath('<path to virtual environment>/lib/python3.X/site-packages/sixs_bin/sixsV1.1')

>>> sixs_bin.get_path("2.1")
PosixPath('<path to virtual environment>/lib/python3.X/site-packages/sixs_bin/sixsV2.1')
```

If you also have [Py6S][Py6S] installed, you can call `sixs_bin.make_wrapper()` to get a `Py6S.SixS` instance that's configured to use the installed 6SV1.1 binary.

```pycon
>>> wrapper = sixs_bin.make_wrapper()

>>> wrapper
<Py6S.sixs.SixS object at 0x...>

>>> wrapper.sixs_path
PosixPath('<path to virtual environment>/lib/python3.X/site-packages/sixs_bin/sixsV1.1')

>>> wrapper.run()
>>> wrapper.outputs.apparent_radiance
134.632
```

## Command Line Usage

Run `python3 -m sixs_bin --help` to see all available command line options.
```none
$ python3 -m sixs_bin --help
usage: python3 -m sixs_bin [-h] [--version]
                           [--path {1.1,2.1} | --exec {1.1,2.1} | --test-wrapper]

6S v1.1 and 6S v2.1 binaries provided as package resources.

optional arguments:
  -h, --help        show this help message and exit
  --version         show program's version number and exit

command:
  --path {1.1,2.1}  Print the path to the specified 6S executable from this package's
                    resources.
  --exec {1.1,2.1}  Execute specified 6S executable in a subprocess, inheriting stdin and
                    stdout. This option is provided as a convenience, but its not
                    generally recommended. Running 6S using this option is around 5%
                    slower than executing the binary directly, due the overhead of
                    starting the Python interpreter and subprocess.
  --test-wrapper    Run Py6S.SixS.test on this package's 6SV1.1 executable.
```

To get the path to an installed 6S binary, run `sixs_bin` as an executable module with the `--path` flag specified. The `--path` flag takes one required argument, which must be either the string `1.1` or `2.1`:
```shell
$ python3 -m sixs_bin --path 2.1
<path to virtual environment>/lib/python3.X/site-packages/sixs_bin/sixsV2.1
```

If you need the path to the containing directory, use `dirname`. For example:
```shell
$ SIXS_DIR=$(dirname $(python3 -m sixs_bin --path 2.1))
$ echo $SIXS_DIR
<path to virtual environment>/lib/python3.X/site-packages/sixs_bin
```

## Test

Tests can be run using pytest:
```shell
$ pytest
```

Some tests are included to check compatibility with Robin Wilson's [Py6S][Py6S] wrapper. These tests will be ignored if `Py6S` is not available.

[Py6S]: https://www.py6s.rtwilson.com/


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/brianschubert/6s-bin",
    "name": "6s-bin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Brian Schubert",
    "author_email": "schubert.b@northeastern.edu",
    "download_url": "https://files.pythonhosted.org/packages/0d/98/8d2a4fe10206cc85b04fcc7c485993ba6da82567a33981571f5cf3b5dd34/6s_bin-0.11.3.tar.gz",
    "platform": null,
    "description": "# 6S Binaries\n\n[![release workflow](https://github.com/brianschubert/6s-bin/actions/workflows/release.yaml/badge.svg?event=push)](https://github.com/brianschubert/6s-bin/actions/workflows/release.yaml)\n[![tests workflow](https://github.com/brianschubert/6s-bin/actions/workflows/test.yaml/badge.svg)](https://github.com/brianschubert/6s-bin/actions/workflows/test.yaml)\n[![PyPI - Version](https://img.shields.io/pypi/v/6s-bin)](https://pypi.org/project/6s-bin)\n[![GitHub last commit (branch)](https://img.shields.io/github/last-commit/brianschubert/6s-bin/develop)](https://github.com/brianschubert/6s-bin/commits/develop)\n[![License](https://img.shields.io/github/license/brianschubert/6s-bin)](./LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/psf/black)\n\nThis distribution provides access to compiled binaries of the [6S Radiative Transfer Model](https://salsa.umd.edu/6spage.html) as [package resources](https://docs.python.org/3/library/importlib.resources.html#module-importlib.resources).\n\nIt *does not* provide a Python interface to 6S. For a Python interface, see  Robin Wilson's [Py6S].\n\nCurrently, this project includes binaries for 6SV1.1 and 6SV2.1. It requires Python 3.9+ and supports Linux, macOS, and Windows.\n\n## Install\n\nPre-compiled wheels can be installed from [PyPI](https://pypi.org/project/6s-bin/):\n```shell\n$ pip install 6s-bin\n```\nIf you are using [poetry](https://python-poetry.org/), you can add this distribution as a dependency using \n`poetry add`:\n```shell\n$ poetry add 6s-bin\n```\n\n### Installing from source\n\nBuilding this distribution involves downloading, validating, and compiling the 6S source code. See [`build.py`](./build.py) for details about the build process. A Fortran 77 compiler is required to compile 6S.\n\nBuild and install from source distribution:\n```shell\n$ pip install --no-binary=6s-bin 6s-bin\n```\n\nBuild and install from git:\n```shell\n$ pip install '6s-bin @ git+https://github.com/brianschubert/6s-bin'\n```\n\nBuild and install from local source tree:\n```shell\n$ pip install .\n```\n\n## Python Usage\n\nCall `sixs_bin.get_path(version)` to get the path to an installed 6S binary. The parameter `version` is required, and must be either the string `\"1.1\"` or `\"2.1\"`.\n```pycon\n>>> import sixs_bin\n\n>>> sixs_bin.get_path(\"1.1\")\nPosixPath('<path to virtual environment>/lib/python3.X/site-packages/sixs_bin/sixsV1.1')\n\n>>> sixs_bin.get_path(\"2.1\")\nPosixPath('<path to virtual environment>/lib/python3.X/site-packages/sixs_bin/sixsV2.1')\n```\n\nIf you also have [Py6S][Py6S] installed, you can call `sixs_bin.make_wrapper()` to get a `Py6S.SixS` instance that's configured to use the installed 6SV1.1 binary.\n\n```pycon\n>>> wrapper = sixs_bin.make_wrapper()\n\n>>> wrapper\n<Py6S.sixs.SixS object at 0x...>\n\n>>> wrapper.sixs_path\nPosixPath('<path to virtual environment>/lib/python3.X/site-packages/sixs_bin/sixsV1.1')\n\n>>> wrapper.run()\n>>> wrapper.outputs.apparent_radiance\n134.632\n```\n\n## Command Line Usage\n\nRun `python3 -m sixs_bin --help` to see all available command line options.\n```none\n$ python3 -m sixs_bin --help\nusage: python3 -m sixs_bin [-h] [--version]\n                           [--path {1.1,2.1} | --exec {1.1,2.1} | --test-wrapper]\n\n6S v1.1 and 6S v2.1 binaries provided as package resources.\n\noptional arguments:\n  -h, --help        show this help message and exit\n  --version         show program's version number and exit\n\ncommand:\n  --path {1.1,2.1}  Print the path to the specified 6S executable from this package's\n                    resources.\n  --exec {1.1,2.1}  Execute specified 6S executable in a subprocess, inheriting stdin and\n                    stdout. This option is provided as a convenience, but its not\n                    generally recommended. Running 6S using this option is around 5%\n                    slower than executing the binary directly, due the overhead of\n                    starting the Python interpreter and subprocess.\n  --test-wrapper    Run Py6S.SixS.test on this package's 6SV1.1 executable.\n```\n\nTo get the path to an installed 6S binary, run `sixs_bin` as an executable module with the `--path` flag specified. The `--path` flag takes one required argument, which must be either the string `1.1` or `2.1`:\n```shell\n$ python3 -m sixs_bin --path 2.1\n<path to virtual environment>/lib/python3.X/site-packages/sixs_bin/sixsV2.1\n```\n\nIf you need the path to the containing directory, use `dirname`. For example:\n```shell\n$ SIXS_DIR=$(dirname $(python3 -m sixs_bin --path 2.1))\n$ echo $SIXS_DIR\n<path to virtual environment>/lib/python3.X/site-packages/sixs_bin\n```\n\n## Test\n\nTests can be run using pytest:\n```shell\n$ pytest\n```\n\nSome tests are included to check compatibility with Robin Wilson's [Py6S][Py6S] wrapper. These tests will be ignored if `Py6S` is not available.\n\n[Py6S]: https://www.py6s.rtwilson.com/\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Compiled binaries for the 6S Radiative Transfer Model exposed as package resources.",
    "version": "0.11.3",
    "project_urls": {
        "Homepage": "https://github.com/brianschubert/6s-bin",
        "Repository": "https://github.com/brianschubert/6s-bin"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c15292acb0070ec00a9bfe26ccd8a4a97a0bd250711123d51fef45db9870188a",
                "md5": "8013f39969faaaeb3a46825a6d1c2e78",
                "sha256": "2c83c6f1a5d3d7774f5c067142cc64ada1129a4af96f8bb33a7104f137f27801"
            },
            "downloads": -1,
            "filename": "6s_bin-0.11.3-py3-none-macosx_12_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "8013f39969faaaeb3a46825a6d1c2e78",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 823858,
            "upload_time": "2024-01-15T15:41:45",
            "upload_time_iso_8601": "2024-01-15T15:41:45.116261Z",
            "url": "https://files.pythonhosted.org/packages/c1/52/92acb0070ec00a9bfe26ccd8a4a97a0bd250711123d51fef45db9870188a/6s_bin-0.11.3-py3-none-macosx_12_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "89b08e6a812d56035e6f18241eecc32bc80eeb5eaaca6220532dbc09e5ec4cb1",
                "md5": "11817c1cfafa1e67a9a56fdce78e0718",
                "sha256": "861abecb7e2c506e62115223512686533af7124d1174cd8bae5761cb650ad483"
            },
            "downloads": -1,
            "filename": "6s_bin-0.11.3-py3-none-manylinux_2_35_x86_64.whl",
            "has_sig": false,
            "md5_digest": "11817c1cfafa1e67a9a56fdce78e0718",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 828168,
            "upload_time": "2024-01-15T15:41:47",
            "upload_time_iso_8601": "2024-01-15T15:41:47.400420Z",
            "url": "https://files.pythonhosted.org/packages/89/b0/8e6a812d56035e6f18241eecc32bc80eeb5eaaca6220532dbc09e5ec4cb1/6s_bin-0.11.3-py3-none-manylinux_2_35_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53b9137e4fa94c0b14a3a4deda6d1b4daa5429b42ba59d9c97d99176d955426c",
                "md5": "1e7e57e6771e1d7841e73fca9b4a4d97",
                "sha256": "1667613f3ef16fe3a4bd30403365c8fd047871c17a28b27c46b5439055aaedd3"
            },
            "downloads": -1,
            "filename": "6s_bin-0.11.3-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "1e7e57e6771e1d7841e73fca9b4a4d97",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 1328450,
            "upload_time": "2024-01-15T15:41:48",
            "upload_time_iso_8601": "2024-01-15T15:41:48.629397Z",
            "url": "https://files.pythonhosted.org/packages/53/b9/137e4fa94c0b14a3a4deda6d1b4daa5429b42ba59d9c97d99176d955426c/6s_bin-0.11.3-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d988d2a4fe10206cc85b04fcc7c485993ba6da82567a33981571f5cf3b5dd34",
                "md5": "e16cfc938e6ba2e653a405e2ea04c3f6",
                "sha256": "2d40f0f4606221d95893a7935b89eadc3725184401c4d1641e99ff41c7402958"
            },
            "downloads": -1,
            "filename": "6s_bin-0.11.3.tar.gz",
            "has_sig": false,
            "md5_digest": "e16cfc938e6ba2e653a405e2ea04c3f6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 13413,
            "upload_time": "2024-01-15T15:41:50",
            "upload_time_iso_8601": "2024-01-15T15:41:50.374432Z",
            "url": "https://files.pythonhosted.org/packages/0d/98/8d2a4fe10206cc85b04fcc7c485993ba6da82567a33981571f5cf3b5dd34/6s_bin-0.11.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-15 15:41:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "brianschubert",
    "github_project": "6s-bin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "6s-bin"
}
        
Elapsed time: 0.44058s