Skip to content

Commit

Permalink
Merge pull request #28 from radionets-project/gpu
Browse files Browse the repository at this point in the history
Gpu
  • Loading branch information
Kevin2 authored Jun 12, 2024
2 parents 5ae0bbc + eaeb4f8 commit b147582
Show file tree
Hide file tree
Showing 39 changed files with 1,381 additions and 1,414 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for news fragment
if: ${{ ! contains( github.event.pull_request.labels.*.name, 'no-changelog-needed')}}
uses: andstor/file-existence-action@v2
uses: andstor/file-existence-action@v3
with:
files: ${{ env.FRAGMENT_NAME }}
fail: true
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
matrix:
include:
- os: ubuntu-latest
python-version: "3.9"
python-version: "3.10"
install-method: mamba

- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
install-method: mamba
extra-args: ["codecov"]

Expand All @@ -34,7 +34,7 @@ jobs:
shell: bash -leo pipefail {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -44,11 +44,11 @@ jobs:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
# setup correct python version
sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml
sed -i -e "s/- python.*/- python=$PYTHON_VERSION/g" environment.yml
- name: mamba setup
if: matrix.install-method == 'mamba'
uses: mamba-org/provision-with-micromamba@v14
uses: mamba-org/setup-micromamba@v1

- name: Install dependencies
run: |
Expand All @@ -66,18 +66,19 @@ jobs:
py.test --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: contains(matrix.extra-args, 'codecov')
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ repos:
rev: 4.0.1
hooks:
- id: flake8
args: [--max-line-length=88, "--extend-ignore=E203"]
args: [--max-line-length=88, "--extend-ignore=E203,E741"]
88 changes: 88 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Pyvisgen v0.2.0 (2024-04-11)
============================


API Changes
-----------


Bug Fixes
---------

- fix baseline num calculation
- fix wavelength scaling
- fix lm grid calculation
- fix gridding so that it fits the numpy fft gridding [`#28 <https://github.com/radionets-project/pyvisgen/pull/28>`__]


New Features
------------

- implement GPU support for visibility calculations
- new grid mode:
- when more than one visibility falls into the same pixel, only the first is calculated
- define grid before calculation
- new dense mode:
- calculate visibilities for a dense uv grid
- simulate ideal interferometer response
- add sensitivity cut in image space:
- avoid calculation of pixel values below detection threshold
- significantly speed-up simulations
- add torch compile to RIME functions [`#28 <https://github.com/radionets-project/pyvisgen/pull/28>`__]


Maintenance
-----------

- delete unused code and relicts
- change from numpy arrays to torch tensors
- change some of the keywords to more common phrases inside the toml config
- update default data_set.toml
- delete old config examples
- avoid torch einsum for better readability of the code [`#28 <https://github.com/radionets-project/pyvisgen/pull/28>`__]


Refactoring and Optimization
----------------------------

- refactor data classes (Visibilities, Baselines)
- add observation class, which holds all relevant information
- drop scan-wise splitting in visibilities calculations, but split all valid baselines equally
- refactor RIME components (currently only uncorrupted available) [`#28 <https://github.com/radionets-project/pyvisgen/pull/28>`__]


Pyvisgen v0.1.4 (2023-11-09)
============================


API Changes
-----------


Bug Fixes
---------

- - fix shape of `num_ifs`
- delete additional bin in masking
- fix ra dec bug [`#25 <https://github.com/radionets-project/pyvisgen/pull/25>`__]


New Features
------------

- update ci:
- change conda to mamba
- install towncrier [`#24 <https://github.com/radionets-project/pyvisgen/pull/24>`__]


Maintenance
-----------

- - update readme [`#26 <https://github.com/radionets-project/pyvisgen/pull/26>`__]

- - add docstrings
- delete unused files [`#27 <https://github.com/radionets-project/pyvisgen/pull/27>`__]


Refactoring and Optimization
----------------------------
10 changes: 0 additions & 10 deletions config/astar.toml

This file was deleted.

10 changes: 0 additions & 10 deletions config/default.toml

This file was deleted.

23 changes: 14 additions & 9 deletions config/data_set.toml → config/default_data_set.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
[sampling_options]
mode = "basic"
mode = "full"
device = "cpu"
seed = 1337
layout = "vla"
img_size = 128
fov_center_ra = [100, 110]
fov_center_dec = [30, 40]
fov_size = 100 # max res 0.1
fov_size = 100
corr_int_time = 30.0
scan_start = ["16-01-2020 00:04:01", "16-01-2020 08:59:59"]
scan_duration = [60, 90]
scans = [1, 2]
interval_length = 360
base_freq = 15.21e9
frequsel = [0e8, 0.8e8, 1.44e8, 2.08e8]
num_scans = [1, 2]
scan_separation = 360
ref_frequency = 15.21e9
frequency_offsets = [0e8, 0.8e8, 1.44e8, 2.08e8]
bandwidths = [6.4e7, 6.4e7, 6.4e7, 6.4e7]
corrupted = true
noisy = 0
corrupted = false
sensitivity_cut = 1e-6

[bundle_options]
in_path = "build/skies/"
in_path = "skies/"
out_path_fits = "build/uvfits"
out_path_gridded = "build/gridded"
num_test_images = 500
bundle_size = 100
train_valid_split = 0.2
grid_size = 128
amp_phase = true
grid_fov = 100
amp_phase = false
10 changes: 0 additions & 10 deletions config/test.toml

This file was deleted.

10 changes: 0 additions & 10 deletions config/vlba.toml

This file was deleted.

3 changes: 0 additions & 3 deletions docs/changes/24.feature.rst

This file was deleted.

4 changes: 4 additions & 0 deletions docs/changes/28.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- fix baseline num calculation
- fix wavelength scaling
- fix lm grid calculation
- fix gridding so that it fits the numpy fft gridding
11 changes: 11 additions & 0 deletions docs/changes/28.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- implement GPU support for visibility calculations
- new grid mode:
- when more than one visibility falls into the same pixel, only the first is calculated
- define grid before calculation
- new dense mode:
- calculate visibilities for a dense uv grid
- simulate ideal interferometer response
- add sensitivity cut in image space:
- avoid calculation of pixel values below detection threshold
- significantly speed-up simulations
- add torch compile to RIME functions
7 changes: 7 additions & 0 deletions docs/changes/28.maintenance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- delete unused code and relicts
- change from numpy arrays to torch tensors
- change some of the keywords to more common phrases inside the toml config
- update default data_set.toml
- delete old config examples
- avoid torch einsum for better readability of the code
- update `ci.yml` and `workflow.yml` for node20
4 changes: 4 additions & 0 deletions docs/changes/28.optimization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- refactor data classes (Visibilities, Baselines)
- add observation class, which holds all relevant information
- drop scan-wise splitting in visibilities calculations, but split all valid baselines equally
- refactor RIME components (currently only uncorrupted available)
3 changes: 2 additions & 1 deletion pyvisgen/fits/data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path

import numpy as np
from astropy.io import fits
from pathlib import Path


class fits_data:
Expand Down
Loading

0 comments on commit b147582

Please sign in to comment.