Metadata-Version: 2.4
Name: marinerg_facility
Version: 2.2.0
Summary: Common elements of the Marinerg Access Portal infrastructure.
Author-email: Irish Centre for High End Computing <james.grogan@ichec.ie>
License: MIT
Project-URL: Repository, https://git.ichec.ie/marinerg-i/facility-service
Project-URL: Homepage, https://git.ichec.ie/marinerg-i/facility-service
Keywords: Web Application,Django
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ichec_django_core==2.1.1
Provides-Extra: container
Requires-Dist: psycopg2-binary; extra == "container"
Requires-Dist: gunicorn; extra == "container"
Provides-Extra: async
Requires-Dist: celery>=5.3; extra == "async"
Requires-Dist: redis>=5.0; extra == "async"
Provides-Extra: types
Requires-Dist: types-requests; extra == "types"
Dynamic: license-file

# Marinerg-i Facility Service

The record of MARINERG-i's marine renewable energy test facilities and their
equipment: who runs each facility, where it is, and the persistent identifiers
(ROR, PIDINST) that let the wider research infrastructure cite it.

It is an installable Django app, `marinerg_facility`, exposing a REST API. It
runs standalone for development, and in production is composed into the
[Test Access Service](https://git.ichec.ie/marinerg-i/test-access-service),
which depends on it. Built for the
[Marinerg-i preparatory phase project](https://www.marinerg-i.eu).

## Quick start

Inspect the script, then run it:

```sh
./infra/quick_start.sh
```

It creates a virtualenv, installs dependencies, loads the demo settings from
`infra/dev.txt`, sets up a local database, creates an admin user, and starts the
development server. Then browse to
[localhost:8000/api](http://localhost:8000/api) for the `facilities`,
`equipment` and tag endpoints.

## Development

```sh
uv sync --group dev
source infra/set_dev_environment.sh
uv run python manage.py migrate
uv run python manage.py runserver
```

Tests, linting and types — the same commands CI runs:

```sh
uv run python -m pytest        # add --no-cov to drop the coverage report
uv run ruff format --check src tests
uv run ruff check src tests
uv run mypy src
```

Tests run against SQLite by default; CI runs them against Postgres, which is
what production uses. The full-text-search tests self-skip on SQLite, so run
them against Postgres before trusting a search change.

More detail in the [Developer Guide](docs/DeveloperGuide.md).

## Partner ROR identifiers

Partner facilities carry a [ROR](https://ror.org) identifier. The values live in
a reviewable data file, applied by a management command that validates each ROR
— format, checksum, and existence in the public registry — before writing it:

```sh
uv run python manage.py populate_ror --emit-template > facility_rors.yaml
# fill in each `ror:` field, then apply (idempotent)
uv run python manage.py populate_ror --mapping facility_rors.yaml
```

`--dry-run` previews, `--no-verify` skips the registry check, `--strict` fails
if a partner facility is left without one, and `--all` widens the template
beyond partners. See `populate_ror --help`.

## Release

Published by the shared `python-package` CI component: run a web pipeline with
`RELEASE_FIELD=patch|minor|major`. Consumers pin this package exactly, so a
release is only visible once they bump their pin.

## Licensing

Copyright of the Irish Centre for High End Computing (ICHEC), released under the
MIT License. See [`LICENSE`](./LICENSE) for the full terms.
