Skip to content

Commit

Permalink
rename everything
Browse files Browse the repository at this point in the history
  • Loading branch information
hrodmn committed Dec 19, 2024
1 parent b51c550 commit 4188425
Show file tree
Hide file tree
Showing 21 changed files with 63 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Steps to reproduce the behavior:

> Ex.
>
> 1. Install stactools-ephemeral
> 1. Install stactools-overture-maps
> 2. Run `scripts/test`
> 3. See error
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ number as needed.

- Nothing.

[Unreleased]: <https://github.com/stactools-packages/ephemeral/tree/main/>
[Unreleased]: <https://github.com/stactools-packages/overture-maps/tree/main/>
24 changes: 12 additions & 12 deletions README-template.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# stactools-ephemeral
# stactools-overture-maps

[![PyPI](https://img.shields.io/pypi/v/stactools-ephemeral?style=for-the-badge)](https://pypi.org/project/stactools-ephemeral/)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/stactools-packages/ephemeral/continuous-integration.yml?style=for-the-badge)
[![PyPI](https://img.shields.io/pypi/v/stactools-overture-maps?style=for-the-badge)](https://pypi.org/project/stactools-overture-maps/)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/stactools-packages/overture-maps/continuous-integration.yml?style=for-the-badge)

- Name: ephemeral
- Package: `stactools.ephemeral`
- [stactools-ephemeral on PyPI](https://pypi.org/project/stactools-ephemeral/)
- Name: overture-maps
- Package: `stactools.overture_maps`
- [stactools-overture-maps on PyPI](https://pypi.org/project/stactools-overture-maps/)
- Owner: @githubusername
- [Dataset homepage](http://example.com)
- STAC extensions used:
- [proj](https://github.com/stac-extensions/projection/)
- Extra fields:
- `ephemeral:custom`: A custom attribute
- [Browse the example in human-readable form](https://radiantearth.github.io/stac-browser/#/external/raw.githubusercontent.com/stactools-packages/ephemeral/main/examples/collection.json)
- [Browse a notebook demonstrating the example item and collection](https://github.com/stactools-packages/ephemeral/tree/main/docs/example.ipynb)
- `overture-maps:custom`: A custom attribute
- [Browse the example in human-readable form](https://radiantearth.github.io/stac-browser/#/external/raw.githubusercontent.com/stactools-packages/overture-maps/main/examples/collection.json)
- [Browse a notebook demonstrating the example item and collection](https://github.com/stactools-packages/overture-maps/tree/main/docs/example.ipynb)

A short description of the package and its usage.

Expand All @@ -25,18 +25,18 @@ A short description of the package and its usage.
## Installation

```shell
pip install stactools-ephemeral
pip install stactools-overture-maps
```

## Command-line usage

Description of the command line functions

```shell
stac ephemeral create-item source destination
stac overture-maps create-item source destination
```

Use `stac ephemeral --help` to see all subcommands and options.
Use `stac overture-maps --help` to see all subcommands and options.

## Contributing

Expand Down
18 changes: 9 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@ RUN conda update conda && \
FROM base as dependencies

ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /opt/stactools-ephemeral
WORKDIR /opt/stactools-overture-maps
COPY --from=base /opt/conda /opt/conda
COPY pyproject.toml ./
COPY src/stactools/ephemeral/__init__.py src/stactools/ephemeral/
COPY src/stactools/overture_maps/__init__.py src/stactools/overture_maps/
RUN apt-get -y -q update \
&& apt-get -y -q install build-essential \
&& rm -rf /var/lib/apt/lists/
RUN python -m venv /opt/venv
RUN pip install . \
&& ls /opt/venv \
&& rm -r /opt/venv/lib/python3.12/site-packages/stactools/ephemeral
&& rm -r /opt/venv/lib/python3.12/site-packages/stactools/overture_maps


FROM dependencies as builder

ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /opt/stactools-ephemeral
WORKDIR /opt/stactools-overture-maps
COPY --from=base /opt/conda /opt/conda
COPY --from=dependencies /opt/venv /opt/venv
COPY pyproject.toml ./
COPY src ./src
RUN pip install -U pip \
&& pip install .
WORKDIR /
RUN rm -rf /opt/stactools-ephemeral
CMD [ "stac", "ephemeralcmd" ]
RUN rm -rf /opt/stactools-overture-maps
CMD [ "stac", "overturemaps" ]


FROM dependencies as dev-dependencies

ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /opt/stactools-ephemeral
WORKDIR /opt/stactools-overture-maps
COPY --from=dependencies /opt/venv /opt/venv
COPY pyproject.toml .
RUN pip install -e '.[dev]' \
Expand All @@ -50,8 +50,8 @@ RUN pip install -e '.[dev]' \
FROM dev-dependencies as dev-builder

ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /opt/stactools-ephemeral
WORKDIR /opt/stactools-overture-maps
COPY --from=base /opt/conda /opt/conda
COPY --from=dependencies /opt/venv /opt/venv
COPY . .
CMD [ "stac", "ephemeralcmd" ]
CMD [ "stac", "overturemaps" ]
4 changes: 2 additions & 2 deletions docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
usage
else
docker build $PULL \
-t stactools-packages/ephemeral:latest \
-t stactools-packages/overture-maps:latest \
-f docker/Dockerfile \
--target builder \
.
docker build $PULL \
-t stactools-packages/ephemeral:dev \
-t stactools-packages/overture-maps:dev \
-f docker/Dockerfile \
--target dev-builder \
.
Expand Down
4 changes: 2 additions & 2 deletions docker/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Runs CI in the docker dev container.

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
docker build $PULL \
-t stactools-packages/ephemeral:dev \
-t stactools-packages/overture-maps:dev \
-f docker/Dockerfile \
--target dev-builder \
.
docker run --rm \
--entrypoint scripts/cibuild \
stactools-packages/ephemeral:dev
stactools-packages/overture-maps:dev
fi
4 changes: 2 additions & 2 deletions docker/console
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Run a console in a docker container with all prerequisites installed.

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
docker run --rm -it \
-v "$(pwd)":/opt/stactools-ephemeral \
-v "$(pwd)":/opt/stactools-overture-maps \
-p 8000:8000 \
--entrypoint /bin/bash \
stactools-packages/ephemeral:dev
stactools-packages/overture-maps:dev
fi
4 changes: 2 additions & 2 deletions docker/lint
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Run code formatters in a docker container with all prerequisites installed.

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
docker run --rm -it \
-v "$(pwd)":/opt/stactools-ephemeral \
-v "$(pwd)":/opt/stactools-overture-maps \
--entrypoint scripts/lint \
stactools-packages/ephemeral:dev
stactools-packages/overture-maps:dev
fi
4 changes: 2 additions & 2 deletions docker/stac
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ will be reflected in the execution.

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
docker run --rm -it \
-v "$(pwd)":/opt/stactools-ephemeral \
stactools-packages/ephemeral:dev "${@}"
-v "$(pwd)":/opt/stactools-overture-maps \
stactools-packages/overture-maps:dev "${@}"
fi
4 changes: 2 additions & 2 deletions docker/test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Run linting and tests in a docker container with all prerequisites installed.

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
docker run --rm -it \
-v "$(pwd)":/opt/stactools-ephemeral \
-v "$(pwd)":/opt/stactools-overture-maps \
--entrypoint scripts/test \
stactools-packages/ephemeral:dev
stactools-packages/overture-maps:dev
fi
8 changes: 4 additions & 4 deletions docs/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# stactools-ephemeral\n",
"# stactools-overture-maps\n",
"\n",
"This is a small notebook demonstrating use of this package and its generated items and collections.\n",
"It is intended to be executed from the root of this repository, since it relies on files that have been checked into this repo."
Expand Down Expand Up @@ -1261,7 +1261,7 @@
"from IPython.display import display\n",
"from pystac import Collection\n",
"\n",
"import stactools.ephemeral.stac\n",
"import stactools.overture_maps.stac\n",
"\n",
"root = Path().cwd().parent\n",
"collection = Collection.from_file(str(root / \"examples\" / \"collection.json\"))\n",
Expand Down Expand Up @@ -1597,8 +1597,8 @@
],
"source": [
"tif_path = root / \"tests\" / \"data\" / \"asset.tif\"\n",
"item = stactools.ephemeral.stac.create_item(str(tif_path))\n",
"collection = stactools.ephemeral.stac.create_collection()\n",
"item = stactools.overture_maps.stac.create_item(str(tif_path))\n",
"collection = stactools.overture_maps.stac.create_collection()\n",
"collection.add_item(item)\n",
"display(collection)"
]
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: stactools-ephemeral
name: stactools-overture-maps
channels:
- conda-forge
- defaults
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "stactools-ephemeral"
name = "stactools-overture-maps"
version = "0.1.0"
description = "PROVIDE DESCRIPTION HERE"
readme = "README.md"
Expand Down Expand Up @@ -34,8 +34,8 @@ dev = [
docs = ["pystac~=1.10", "ipykernel~=6.29", "jinja2~=3.1"]

[project.urls]
Github = "https://github.com/stactools-packages/ephemeral"
Issues = "https://github.com/stactools-packages/ephemeral/issues"
Github = "https://github.com/stactools-packages/overture-maps"
Issues = "https://github.com/stactools-packages/overture-maps/issues"

[build-system]
requires = ["setuptools", "wheel"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
*.py ./**/*.py \
*.md

pytest --cov=stactools.ephemeral tests
pytest --cov=stactools.overture_maps tests
coverage xml
fi
fi
6 changes: 3 additions & 3 deletions scripts/update-examples
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ from pathlib import Path

from pystac import CatalogType

import stactools.ephemeral.stac
import stactools.overture_maps.stac

root = Path(__file__).parents[1]
examples = root / "examples"

collection = stactools.ephemeral.stac.create_collection()
item = stactools.ephemeral.stac.create_item(str(root / "tests" / "data" / "asset.tif"))
collection = stactools.overture_maps.stac.create_collection()
item = stactools.overture_maps.stac.create_item(str(root / "tests" / "data" / "asset.tif"))
collection.add_item(item)
collection.update_extent_from_items()
collection.normalize_hrefs(str(examples))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import stactools.core
from stactools.cli.registry import Registry
from stactools.ephemeral.stac import create_collection, create_item
from stactools.overture_maps.stac import create_collection, create_item

__all__ = ["create_collection", "create_item"]

stactools.core.use_fsspec()


def register_plugin(registry: Registry) -> None:
from stactools.ephemeral import commands
from stactools.overture_maps import commands

registry.register_subcommand(commands.create_ephemeralcmd_command)
registry.register_subcommand(commands.create_overturemaps_command)
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
import click
from click import Command, Group

from stactools.ephemeral import stac
from stactools.overture_maps import stac

logger = logging.getLogger(__name__)


def create_ephemeralcmd_command(cli: Group) -> Command:
"""Creates the stactools-ephemeral command line utility."""
def create_overturemaps_command(cli: Group) -> Command:
"""Creates the stactools-overture-maps command line utility."""

@cli.group(
"ephemeralcmd",
short_help=("Commands for working with stactools-ephemeral"),
"overturemaps",
short_help=("Commands for working with stactools-overture-maps"),
)
def ephemeralcmd() -> None:
def overturemaps() -> None:
pass

@ephemeralcmd.command(
@overturemaps.command(
"create-collection",
short_help="Creates a STAC collection",
)
Expand All @@ -33,7 +33,7 @@ def create_collection_command(destination: str) -> None:
collection.set_self_href(destination)
collection.save_object()

@ephemeralcmd.command("create-item", short_help="Create a STAC item")
@overturemaps.command("create-item", short_help="Create a STAC item")
@click.argument("source")
@click.argument("destination")
def create_item_command(source: str, destination: str) -> None:
Expand All @@ -46,4 +46,4 @@ def create_item_command(source: str, destination: str) -> None:
item = stac.create_item(source)
item.save_object(dest_href=destination)

return ephemeralcmd
return overturemaps
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from click.testing import CliRunner
from pystac import Collection, Item

from stactools.ephemeral.commands import create_ephemeralcmd_command
from stactools.overture_maps.commands import create_overturemaps_command

from . import test_data

command = create_ephemeralcmd_command(Group())
command = create_overturemaps_command(Group())


def test_create_collection(tmp_path: Path) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stac.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stactools.ephemeral import stac
from stactools.overture_maps import stac

from . import test_data

Expand Down
Loading

0 comments on commit 4188425

Please sign in to comment.