Metadata-Version: 2.4
Name: lofar-parameterset
Version: 0.0.1
Summary: Minimal Python implementation of the LOFAR ParameterSet
Author-email: Jan David Mol <mol@astron.nl>
License: GPL-3.0-or-later
Project-URL: repository, https://git.astron.nl/lofar2.0/lofar_pyparameterset
Keywords: LOFAR,ParameterSet
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# LOFAR Python ParameterSet

![Build status](https://git.astron.nl/lofar2.0/lofar_pyparameterset/badges/main/pipeline.svg)
![Test coverage](https://git.astron.nl/lofar2.0/lofar_pyparameterset/badges/main/coverage.svg)
<!-- ![Latest release](https://git.astron.nl/lofar2.0/lofar_pyparameterset/badges/main/release.svg) -->

Minimal Python implementation of the LOFAR ParameterSet

## Installation

Installation can be done in a number of ways. In order of preference (read:
ease of use):

1. Install the latest release from PyPI:

    ```
    pip install lofar-parameterset
    ```

2. Install directly from the Git repository. This option is useful if you want to use one or more features that have not yet been released:

    ```
    pip install --upgrade pip
    pip install git+https://git.astron.nl/lofar2.0/lofar_pyparameterset.git[@<branch|tag|hash>]
    ```
    If the optional `@<branch|tag|hash>` is omitted, `HEAD` of the `master` branch will used.

3. Clone the git repository, and install from your working copy. This option is mostly used by developers who want to make local changes:

    ```
    pip install --upgrade pip
    git clone https://git.astron.nl/lofar2.0/lofar_pyparameterset.git
    cd lofar_pyparameterset
    git checkout [<branch|tag|hash>]  #optionally
    pip install .
    ```

## Usage
Here is a example of how one could read attenuation settings from a parset file:
```python
from lofar_parameterset.parameterset import parameterset
with open("settings.parset") as f:
    parset = parameterset(parameterset.fromString(f.read()))
attenuations = parset.getDoubleVector("attenuations")
```

## Development

### Development environment

To setup and activte the develop environment run ```source ./setup.sh``` from within the source directory.

If PyCharm is used, this only needs to be done once.
Afterward the Python virtual env can be setup within PyCharm.

### Contributing
To contribute, please create a feature branch and a "Draft" merge request.
Upon completion, the merge request should be marked as ready and a reviewer
should be assigned.

Verify your changes locally and be sure to add tests. Verifying local
changes is done through `tox`.

```pip install tox```

With tox the same jobs as run on the CI/CD pipeline can be ran. These
include unit tests and linting.

```tox```

To automatically apply most suggested linting changes execute:

```tox -e format```

The configuration for linting and tox can be found in `pyproject.toml`

## License and copyright
This project is licensed under the GNU General Public License v3.0 or later.

Copyright &copy; 2024 - 2025, ASTRON (Netherlands Institute for Radio Astronomy)
