Python Source Extractor
Project description
Python Source Extractor
This is the Python Source Extractor (PySE) for extraction and measurement of sources in radio astronomical images, or, more generally, images from aperture synthesis. This means that PySE has been tested thoroughly on images with correlated noise. PySE was primarily designed for the LOFAR Transients Key Project (TKP), i.e. targeting the detection of transient sources, which will be mostly unresolved.
Recent development - 2020 - 2023 - has been funded by grant 27019G06 from the Netherlands eScience Center for PADRE.
Current development is internally funded by The Netherlands eScience Center through the Software Sustainability Project “PySE”.
The code in this repo was formerly part of the LOFAR Transients Pipeline (TraP) repo. Compatibility with TraP is maintained, i.e. the output of PySE is suitable for futher processing in TraP. Also, PySE is still included and regularly updated in Trap. A reason for starting this repo is to offer PySE as a standalone application.
Documentation
Installation
PySE has an entry on PyPI:
$ pip install radio-pyse
PySE is compatible with Python 3.10 or up.
License
PySE was released under the BSD-2 license.
Developer information
PySE uses hatch to manage the different environments during development. So make sure you have hatch installed globally. You could either use your system’s package manager to install hatch, or use pipx to install as a regular user. Please ensure that you are using a version hatch>=1.10, otherwise you might encounter this bug.
In general, to run command in a specific environment managed by hatch, you can do this:
$ hatch run <environment>:<command> [--options]
You can see a summary of all the evironments managed by hatch like this:
$ hatch env show
Standalone
┏━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Name ┃ Type ┃ Dependencies ┃
┡━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ default │ virtual │ │
├─────────┼─────────┼──────────────┤
│ test │ virtual │ pytest │
│ │ │ pytest-cov │
├─────────┼─────────┼──────────────┤
│ lint │ virtual │ black │
│ │ │ flake8 │
│ │ │ mypy │
│ │ │ ruff │
└─────────┴─────────┴──────────────┘
Matrices
┏━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃ Name ┃ Type ┃ Envs ┃ Dependencies ┃
┡━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
│ test │ virtual │ test.py3.10 │ pytest │
│ │ │ test.py3.11 │ pytest-cov │
│ │ │ test.py3.12 │ │
│ │ │ test.py3.13 │ │
└──────┴─────────┴─────────────┴──────────────────┘
As shown above, the test environments also define a matrix to cover multiple Python versions. So we can run the whole test matrix locally with:
$ hatch run test:pytest
Instead if you want to run only a subset, you can limit the python versions like this:
$ hatch run +py=3.13 test:pytest # +py and +python are equivalent
$ hatch run +python=3.13 test:pytest
$ hatch run +python=3.12,3.13 test:pytest
For more options, see hatch env run -h.
Some common tasks using hatch are summarised below.
Package builds
hatch does package builds in an isolated environment. The package build setup also uses a dynamic hook (also known as build hooks) to generate the package version from Git repository release tags. So to do a local package build, you need to ensure all Git tags are present.
Fetch all Git release tags locally.
$ git fetch --tagsYou can now build a distribution (a wheel file and a source tarball) locally using:
$ hatch buildThis creates the distribution files in the dist/ directory in the project root.
$ tree dist/ dist/ ├── radio_pyse-0.3.2.dev9+gfb04dc7.d20240729-py3-none-any.whl └── radio_pyse-0.3.2.dev9+gfb04dc7.d20240729.tar.gz
If you want to trigger only the build hooks (like generating the package version), you can do:
$ hatch build --hooks-onlyThis is necessary to refresh the version information if you update any of the build configuration in pyproject.toml, or if you are implementing something that depends on the version, e.g. making a new capability available only for a newer version.
Running the test suite
$ hatch run test:pytest [tests/test_iwanttorun.py] [-k match_string] [--options]
$ hatch run test:pytest --no-cov # to disable coverage
Running formatters and static analysis tools
You can run supported linters/formatters (see the environment definition for lint) like this.
$ hatch run lint:mypy [--options]
$ hatch run lint:flake8 [--options]
$ hatch run lint:ruff check sourcefinder
$ hatch run lint:black --check sourcefinder
Note that on first run, mypy might need to install type-stubs. You can do that with:
$ hatch run lint:mypy --install-type --non-interactive
Running scripts that use PySE
Normally a regular user would install a released version from PyPI, but to use a development version you may run such scripts like this:
$ hatch run pyse [--options]
Since the development environment is the default, you don’t need to specify the <envrironment>: prefix in the run command.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file radio_pyse-0.7.1.tar.gz.
File metadata
- Download URL: radio_pyse-0.7.1.tar.gz
- Upload date:
- Size: 110.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b12d364e2f7f626011c3066b974a945a76a4c8ef2e59ec9613cd3dde614cabb
|
|
| MD5 |
1eba9ff5926ac06788ac56b159a8cade
|
|
| BLAKE2b-256 |
ba59ac6fe3bda1f5d8215801d15e3594affec38c295b0682e70aa9b3f5c1a317
|
Provenance
The following attestation bundles were made for radio_pyse-0.7.1.tar.gz:
Publisher:
publish-pypi.yml on transientskp/pyse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
radio_pyse-0.7.1.tar.gz -
Subject digest:
2b12d364e2f7f626011c3066b974a945a76a4c8ef2e59ec9613cd3dde614cabb - Sigstore transparency entry: 768583721
- Sigstore integration time:
-
Permalink:
transientskp/pyse@2bfff3e9a99bc223a38c354c38ac17710b300dfa -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/transientskp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2bfff3e9a99bc223a38c354c38ac17710b300dfa -
Trigger Event:
release
-
Statement type:
File details
Details for the file radio_pyse-0.7.1-py3-none-any.whl.
File metadata
- Download URL: radio_pyse-0.7.1-py3-none-any.whl
- Upload date:
- Size: 127.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e217a508896f9fe50d0309dee83bae817095b3bc98261bc950b64fab4f8db012
|
|
| MD5 |
c02d6c66c45c0f7ce5e35bc71ad039a1
|
|
| BLAKE2b-256 |
864d7e6f89bfcd90579f79c129c685a50f392b48342541bdd5db550b762a83b4
|
Provenance
The following attestation bundles were made for radio_pyse-0.7.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on transientskp/pyse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
radio_pyse-0.7.1-py3-none-any.whl -
Subject digest:
e217a508896f9fe50d0309dee83bae817095b3bc98261bc950b64fab4f8db012 - Sigstore transparency entry: 768583736
- Sigstore integration time:
-
Permalink:
transientskp/pyse@2bfff3e9a99bc223a38c354c38ac17710b300dfa -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/transientskp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2bfff3e9a99bc223a38c354c38ac17710b300dfa -
Trigger Event:
release
-
Statement type: