shoreline


Nameshoreline JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryNATURESCAPES shoreline analysis
upload_time2025-03-31 15:04:23
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords gis shoreline analysis dsas
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NATURESCAPES `shoreline` Package
![PyPI - Format](https://img.shields.io/pypi/format/shoreline?link=https%3A%2F%2Fpypi.org%2Fproject%2Fshoreline%2F)

This is the repo for the Naturescapes `shoreline` package and research notebooks.

Utilities for ray casting, working with LineString resolution, and clipping rays have been organized as a Python package in the `src` directory. The main interface is provided by the `ShorelineAnalyzer` class.

**The minimum supported Python version is Python 3.10**.

## Usage (see `shoreline.ipynb` for example)
```python
from shoreline import ShorelineAnalyzer

# Create a new analyzer
analyzer = ShorelineAnalyzer()
sa = ShorelineAnalyzer(
    crs="EPSG:25829",
    shoreline="geodata/ireland/gadm36_IRL_shp/gadm36_IRL_0.shp",
    tideline="geodata/cleanup/Calculated Contours Backup/vorf_lat_simplified.gpkg",
    hat=2.09,
    lat=-2.44,
    wave_period=3.0,
    wave_height=2.0,
    ray_resolution=10
)
analysis = sa.evaluate()
# we now have a result object containing analysis metadata (.metadata), as well as geometries
# and summary stats
# call help(analysis) for more

# we can plot results if we're using a notebook. pl is a tuple of Matplotlib figures
pl = analysis.visualise_coastal_slopes()
# this gives us a (map, stats) tuple
pl[0].savefig("dublin.png", dpi=300, bbox_inches="tight")
# you can also call analysis.summary_stats()

```

## Sample output from [`shoreline.ipynb`](isobath_to_onshore.ipynb)
![Dublin Bay](test.png "Dublin Bay, with smoothed rays cast offshore to onshore")

## Sample output of a ray intersecting isobaths [`ray_slope.ipynb`](ray_slope.ipynb)
![Ray / Slope](ray_slope.png "Using a divergent colour scheme to visualise slope orientation")

# Installation
`uv add shoreline` or `pip install shoreline`

## Installing for local development
This project is developed using [`uv`](https://docs.astral.sh/uv/),  but should work with just pip. The use of a virtualenv is advised.

```shell
uv venv
source .venv/bin/activate
uv sync --all-extras

uv add --dev ipykernel
uv run ipython kernel install --user --env VIRTUAL_ENV $(pwd)/.venv --name=shoreline
uv run --with jupyter jupyter lab
```
When creating a notebook, select the **`shoreline`** kernel from the dropdown. Then use e.g. `!uv add pydantic` to add pydantic to the project's dependencies, or `!uv pip install pydantic` to install pydantic into the project's virtual environment without persisting the change to the project `pyproject.toml` or `uv.lock files`. Either command will make import pydantic work within the notebook

### Anaconda
For Anaconda users: you will probably have to pull the requirements out of `pyproject.toml`. Sorry!

## Testing
The smoothing algorithm is relatively well covered by tests (see `tests/test_utils.py`). Run `pytest` in the root dir in order to test if you'd like to tinker with it.

## Data
Are in the [`geodata`](geodata) folder.

## Copyright
Stephan Hügel / Naturescapes, 2025

## Funding
The NATURESCAPES project is funded by the European Union under Grant Agreement No 10108434

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "shoreline",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "gis, shoreline, analysis, DSAS",
    "author": null,
    "author_email": "Stephan H\u00fcgel <shugel@tcd.ie>",
    "download_url": "https://files.pythonhosted.org/packages/d2/85/57a6f66f6311e3f59786d689c31a18ea989d9151dbfb6b521ac87e6e0aa7/shoreline-0.1.2.tar.gz",
    "platform": null,
    "description": "# NATURESCAPES `shoreline` Package\n![PyPI - Format](https://img.shields.io/pypi/format/shoreline?link=https%3A%2F%2Fpypi.org%2Fproject%2Fshoreline%2F)\n\nThis is the repo for the Naturescapes `shoreline` package and research notebooks.\n\nUtilities for ray casting, working with LineString resolution, and clipping rays have been organized as a Python package in the `src` directory. The main interface is provided by the `ShorelineAnalyzer` class.\n\n**The minimum supported Python version is Python 3.10**.\n\n## Usage (see `shoreline.ipynb` for example)\n```python\nfrom shoreline import ShorelineAnalyzer\n\n# Create a new analyzer\nanalyzer = ShorelineAnalyzer()\nsa = ShorelineAnalyzer(\n    crs=\"EPSG:25829\",\n    shoreline=\"geodata/ireland/gadm36_IRL_shp/gadm36_IRL_0.shp\",\n    tideline=\"geodata/cleanup/Calculated Contours Backup/vorf_lat_simplified.gpkg\",\n    hat=2.09,\n    lat=-2.44,\n    wave_period=3.0,\n    wave_height=2.0,\n    ray_resolution=10\n)\nanalysis = sa.evaluate()\n# we now have a result object containing analysis metadata (.metadata), as well as geometries\n# and summary stats\n# call help(analysis) for more\n\n# we can plot results if we're using a notebook. pl is a tuple of Matplotlib figures\npl = analysis.visualise_coastal_slopes()\n# this gives us a (map, stats) tuple\npl[0].savefig(\"dublin.png\", dpi=300, bbox_inches=\"tight\")\n# you can also call analysis.summary_stats()\n\n```\n\n## Sample output from [`shoreline.ipynb`](isobath_to_onshore.ipynb)\n![Dublin Bay](test.png \"Dublin Bay, with smoothed rays cast offshore to onshore\")\n\n## Sample output of a ray intersecting isobaths [`ray_slope.ipynb`](ray_slope.ipynb)\n![Ray / Slope](ray_slope.png \"Using a divergent colour scheme to visualise slope orientation\")\n\n# Installation\n`uv add shoreline` or `pip install shoreline`\n\n## Installing for local development\nThis project is developed using [`uv`](https://docs.astral.sh/uv/),  but should work with just pip. The use of a virtualenv is advised.\n\n```shell\nuv venv\nsource .venv/bin/activate\nuv sync --all-extras\n\nuv add --dev ipykernel\nuv run ipython kernel install --user --env VIRTUAL_ENV $(pwd)/.venv --name=shoreline\nuv run --with jupyter jupyter lab\n```\nWhen creating a notebook, select the **`shoreline`** kernel from the dropdown. Then use e.g. `!uv add pydantic` to add pydantic to the project's dependencies, or `!uv pip install pydantic` to install pydantic into the project's virtual environment without persisting the change to the project `pyproject.toml` or `uv.lock files`. Either command will make import pydantic work within the notebook\n\n### Anaconda\nFor Anaconda users: you will probably have to pull the requirements out of `pyproject.toml`. Sorry!\n\n## Testing\nThe smoothing algorithm is relatively well covered by tests (see `tests/test_utils.py`). Run `pytest` in the root dir in order to test if you'd like to tinker with it.\n\n## Data\nAre in the [`geodata`](geodata) folder.\n\n## Copyright\nStephan H\u00fcgel / Naturescapes, 2025\n\n## Funding\nThe NATURESCAPES project is funded by the European Union under Grant Agreement No 10108434\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "NATURESCAPES shoreline analysis",
    "version": "0.1.2",
    "project_urls": {
        "Repository": "https://github.com/urschrei/naturescapes",
        "Tracker": "https://github.com/urschrei/naturescapes/issues"
    },
    "split_keywords": [
        "gis",
        " shoreline",
        " analysis",
        " dsas"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2b47849fb7eff6dffeaf803fc2dbca9ceaf3c55bde6adbdff2985e42b87479a8",
                "md5": "48a02f91c881381779a68617d67c0d41",
                "sha256": "10c0946109f27c189b2d810eec59496989b84c0b645aa9d2940f531851539016"
            },
            "downloads": -1,
            "filename": "shoreline-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "48a02f91c881381779a68617d67c0d41",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 29374,
            "upload_time": "2025-03-31T15:04:22",
            "upload_time_iso_8601": "2025-03-31T15:04:22.475634Z",
            "url": "https://files.pythonhosted.org/packages/2b/47/849fb7eff6dffeaf803fc2dbca9ceaf3c55bde6adbdff2985e42b87479a8/shoreline-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d28557a6f66f6311e3f59786d689c31a18ea989d9151dbfb6b521ac87e6e0aa7",
                "md5": "93b120d4fd90aeae78f2a97391e11376",
                "sha256": "b4ab29f28b127a19743a90dce0a9b138eb5d15aad77c8e36299a16660a871257"
            },
            "downloads": -1,
            "filename": "shoreline-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "93b120d4fd90aeae78f2a97391e11376",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 30576,
            "upload_time": "2025-03-31T15:04:23",
            "upload_time_iso_8601": "2025-03-31T15:04:23.780280Z",
            "url": "https://files.pythonhosted.org/packages/d2/85/57a6f66f6311e3f59786d689c31a18ea989d9151dbfb6b521ac87e6e0aa7/shoreline-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-31 15:04:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "urschrei",
    "github_project": "naturescapes",
    "github_not_found": true,
    "lcname": "shoreline"
}
        
Elapsed time: 0.41068s