Skip to main content

LOFAR Python ParameterSet

Build status Test coverage

Overview

This package contains a pure-python drop-in replacement for the python wrapper around the original LOFAR ParameterSet that is written in C++. It supports only the basic features of the original.

The following, more fancy, features are not supported:

  • Vector expansion, e.g., foo=['bar'*4] and foo=[1..5]
  • Value interpretations beyond bool, int, float, and string
  • Multi-line values
  • String escaping beyond either " or ' in the string
  • Modeling of ParameterValue as a separate class
  • Case-insensitivity of keys
  • Tracking of unused keys

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:

from lofar_parameterset.parameterset import parameterset
parset = parameterset.fromFile("settings.parset")
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 © 2024 - 2025, ASTRON (Netherlands Institute for Radio Astronomy)

Metadata

Release files for lofar-parameterset 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lofar-parameterset 1.1
File Size Uploaded
lofar_parameterset-1.1.tar.gz 30.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lofar-parameterset 1.1
File Interpreter ABI Platform
lofar_parameterset-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 48.4 kB

Release files / lofar_parameterset-1.1.tar.gz

Download URL lofar_parameterset-1.1.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d0022f4bc7c6f052d7775b8a53003c1dcda130cab996c3ae0dcf65b0f74c3315
BLAKE2b-256 checksum
How to use checksums
1b9414fdab7af10697e70eb98b197b8cc9d3b0fb131d7a0352ce02b088437daf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / lofar_parameterset-1.1-py3-none-any.whl

Download URL lofar_parameterset-1.1-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9584a1b3868b12da492f991d094cddf8f9bce79fa61653b9e2cb3b7b30664ecc
BLAKE2b-256 checksum
How to use checksums
b10b1aa88aee1aea08ee5801c659de70a75c02f0378f9400f1e1d36d0de4cd9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.0

2 release files

0.0.4

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page