From 3e3bd0be28308fb108e9f7699668e50386c1f1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Gro=C3=9F?= Date: Mon, 15 Jul 2024 11:33:30 +0200 Subject: [PATCH 01/26] Add tqdm to vis_loop --- pyvisgen/simulation/visibility.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyvisgen/simulation/visibility.py b/pyvisgen/simulation/visibility.py index 0e720eb..24bb96e 100644 --- a/pyvisgen/simulation/visibility.py +++ b/pyvisgen/simulation/visibility.py @@ -4,6 +4,8 @@ import pyvisgen.simulation.scan as scan +from tqdm import tqdm + @dataclass class Visibilities: @@ -37,7 +39,7 @@ def add(self, visibilities): ] -def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full"): +def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full", batch_size=100): torch.set_num_threads(num_threads) torch._dynamo.config.suppress_errors = True @@ -93,7 +95,7 @@ def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full"): else: raise ValueError("Unsupported mode!") - for p in torch.arange(bas[:].shape[1]).split(1000): + for p in tqdm(torch.arange(bas[:].shape[1]).split(batch_size)): bas_p = bas[:][:, p] int_values = torch.cat( @@ -163,4 +165,4 @@ def generate_noise(shape, obs, SEFD): noise = torch.normal(mean=0, std=std, size=shape, device=obs.device) noise = noise + 1.0j * torch.normal(mean=0, std=std, size=shape, device=obs.device) - return noise + return noise \ No newline at end of file From 2be7d2e470cb35883b3626128e5710674fc00115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Gro=C3=9F?= Date: Mon, 15 Jul 2024 11:45:47 +0200 Subject: [PATCH 02/26] Add changelog --- docs/changes/33.feature.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/changes/33.feature.rst diff --git a/docs/changes/33.feature.rst b/docs/changes/33.feature.rst new file mode 100644 index 0000000..2864257 --- /dev/null +++ b/docs/changes/33.feature.rst @@ -0,0 +1,3 @@ +Changes to `vis_loop` function in `visibility.py`: +- add a tqdm progress bar to get a visual confirmation the calculation is still running +- add optional `batch_size` parameter to control memory consumption From 0babea92ce3e3f9cb4515934baaf7ae1758b8cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Gro=C3=9F?= Date: Mon, 15 Jul 2024 13:29:26 +0200 Subject: [PATCH 03/26] Change tqdm for vis_loop to optional --- pyvisgen/simulation/visibility.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyvisgen/simulation/visibility.py b/pyvisgen/simulation/visibility.py index 24bb96e..4c4d754 100644 --- a/pyvisgen/simulation/visibility.py +++ b/pyvisgen/simulation/visibility.py @@ -39,7 +39,7 @@ def add(self, visibilities): ] -def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full", batch_size=100): +def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full", batch_size=100, use_tqdm=False): torch.set_num_threads(num_threads) torch._dynamo.config.suppress_errors = True @@ -95,7 +95,12 @@ def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full", batch_size=100): else: raise ValueError("Unsupported mode!") - for p in tqdm(torch.arange(bas[:].shape[1]).split(batch_size)): + batches = torch.arange(bas[:].shape[1]).split(batch_size) + + if use_tqdm: + batches = tqdm(batches) + + for p in batches: bas_p = bas[:][:, p] int_values = torch.cat( From d69b898f6dadb2e05a0aff6153dcdde08dbb8cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Gro=C3=9F?= Date: Mon, 15 Jul 2024 13:38:40 +0200 Subject: [PATCH 04/26] Update changelog --- docs/changes/33.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changes/33.feature.rst b/docs/changes/33.feature.rst index 2864257..cc83a98 100644 --- a/docs/changes/33.feature.rst +++ b/docs/changes/33.feature.rst @@ -1,3 +1,3 @@ Changes to `vis_loop` function in `visibility.py`: -- add a tqdm progress bar to get a visual confirmation the calculation is still running +- add a an optional tqdm progress bar to get a visual confirmation the calculation is still running - add optional `batch_size` parameter to control memory consumption From 9b018115a7e88226855dd688773c50cc5e8a881b Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 12:29:26 +0200 Subject: [PATCH 05/26] fix writer in case of more frequency bands --- pyvisgen/fits/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyvisgen/fits/writer.py b/pyvisgen/fits/writer.py index a422a41..f17f97d 100644 --- a/pyvisgen/fits/writer.py +++ b/pyvisgen/fits/writer.py @@ -39,7 +39,7 @@ def create_vis_hdu(data, obs, layout="vlba", source_name="sim-source-0"): ra = obs.ra.cpu().numpy().item() dec = obs.dec.cpu().numpy().item() freq = obs.ref_frequency.cpu().numpy().item() - freq_d = obs.bandwidths.cpu().numpy().item() + freq_d = obs.bandwidths[0].cpu().numpy().item() ws = wcs.WCS(naxis=7) ws.wcs.crpix = [1, 1, 1, 1, 1, 1, 1] From bc3847ddedeffcbfd3ebe9a1cfb2400a8e78988b Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 12:31:00 +0200 Subject: [PATCH 06/26] add test for fits writer --- tests/test_simulation.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_simulation.py b/tests/test_simulation.py index 7463531..4227924 100644 --- a/tests/test_simulation.py +++ b/tests/test_simulation.py @@ -30,6 +30,7 @@ def test_create_sampling_rc(): def test_vis_loop(): import torch + import pyvisgen.fits.writer as writer from pyvisgen.simulation.data_set import create_observation from pyvisgen.simulation.visibility import vis_loop from pyvisgen.utils.data import load_bundles, open_bundles @@ -57,3 +58,9 @@ def test_vis_loop(): # num_vis_calc = vis_data.base_num[vis_data.date == vis_data.date[0]].shape[0] # dunno what's going on here # assert num_vis_theory == num_vis_calc + # + + out_path = Path(conf["out_path_fits"]) + out = out_path / Path("vis_0.fits") + hdu_list = writer.create_hdu_list(vis_data, obs) + hdu_list.writeto(out, overwrite=True) From ff1f4c3a7a9e5ffc57ce1879099748ad526bf3b4 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 12:32:10 +0200 Subject: [PATCH 07/26] update changelog --- docs/changes/31.maintenance.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changes/31.maintenance.rst b/docs/changes/31.maintenance.rst index 09ba8d9..18edcff 100644 --- a/docs/changes/31.maintenance.rst +++ b/docs/changes/31.maintenance.rst @@ -1 +1,2 @@ - use observation class to pass sampling options to the fits writer +- include writer in tests From 98a3e886f8edd3ca34839b485267479d2db603f8 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 13:53:59 +0200 Subject: [PATCH 08/26] fix astropy version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c8533a7..802b37a 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ packages=find_packages(), install_requires=[ "numpy", - "astropy", + "astropy=6.1.0", "matplotlib", "ipython", "scipy", From 625040185ce45bc3fc4ade85da8fe99048d1f574 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 13:58:12 +0200 Subject: [PATCH 09/26] fix astropy version --- environment.yml | 1 + setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 6e2c2d4..d4f17eb 100644 --- a/environment.yml +++ b/environment.yml @@ -8,6 +8,7 @@ dependencies: - python - pytorch - numpy + - astropy<=6.1.0 - pip - pip: - towncrier diff --git a/setup.py b/setup.py index 802b37a..c8533a7 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ packages=find_packages(), install_requires=[ "numpy", - "astropy=6.1.0", + "astropy", "matplotlib", "ipython", "scipy", From 488fcf4e53e120c85f9d64d2bddac22494ead9ea Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:03:43 +0200 Subject: [PATCH 10/26] fix astropy version --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index c8533a7..4337638 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,6 @@ packages=find_packages(), install_requires=[ "numpy", - "astropy", "matplotlib", "ipython", "scipy", From 9c026534091c49ad9f0d9c5382684a756764f736 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:08:08 +0200 Subject: [PATCH 11/26] set astropy version to 6.1.0 --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index d4f17eb..f17a981 100644 --- a/environment.yml +++ b/environment.yml @@ -8,8 +8,8 @@ dependencies: - python - pytorch - numpy - - astropy<=6.1.0 - pip - pip: - towncrier + - astropy==6.1.0 - -e . From 140584097d57511e2b884c7890a5b68aee5fe8f6 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:40:08 +0200 Subject: [PATCH 12/26] create pyproject.toml --- pyproject.toml | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1090f2f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,91 @@ +[build-system] +requires = ["setuptools>=64", "setuptools_scm[toml]>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyvisgen" +version = "0.2.0" +description = "Simulate radio interferometer observations and visibility generation with the RIME formalism." +readme = "README.md" +authors = [ + {name = "Kevin Schmidt, Felix Geyer, Stefan Fröse"}, +] +maintainers = [ + {name = "Kevin Schmidt", email = "kevin3.schmidt@tu-dortmund.de"}, + {name = "Felix Geyer", email = "felix.geyer@tu-dortmund.de"}, +] +license = {text = "MIT"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Astronomy", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering :: Information Analysis", + "Development Status :: 4 - Beta", +] + +dynamic = ["version"] +requires-python = ">=3.10" + +dependencies = [ + "numpy", + "astropy<=6.1.0", + "matplotlib", + "ipython", + "scipy", + "pandas", + "toml", + "pytest", + "pytest-cov", + "jupyter", + "astroplan", + "torch", + "tqdm", + "numexpr", + "click", + "h5py", + "natsort", + "pre-commit", +] + +[project.scripts] + pyvisgen_create_dataset = "pyvisgen.simulation.scripts.create_dataset:main" + +[tool.towncrier] + package = "ctapipe" + directory = "docs/changes" + filename = "CHANGES.rst" + template = "docs/changes/template.rst" + # let towncrier create proper links to the merged PR + issue_format = "`#{issue} `__" + + [tool.towncrier.fragment.feature] + name = "New Features" + showcontent = true + + [tool.towncrier.fragment.bugfix] + name = "Bug Fixes" + showcontent = true + + [tool.towncrier.fragment.api] + name = "API Changes" + showcontent = true + + [tool.towncrier.fragment.datamodel] + name = "Data Model Changes" + showcontent = true + + [tool.towncrier.fragment.optimization] + name = "Refactoring and Optimization" + showcontent = true + + [tool.towncrier.fragment.maintenance] + name = "Maintenance" + showcontent = true + + [[tool.towncrier.section]] + name = "" + path = "" From 3c534e9ba30e958bdc23bd5784d512a2788cc43a Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:40:33 +0200 Subject: [PATCH 13/26] delete old setup files --- setup.cfg | 5 ----- setup.py | 57 ------------------------------------------------------- 2 files changed, 62 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 20ce0d7..0000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[aliases] -test=pytest - -[tool:pytest] -addopts = -v diff --git a/setup.py b/setup.py deleted file mode 100644 index c8533a7..0000000 --- a/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -from setuptools import find_packages, setup - -setup( - name="pyvisgen", - version="0.2.0", - description="Simulate radio interferometer observations \ - and visibility generation with the RIME formalism.", - url="https://github.com/radionets-project/pyvisgen", - author="Kevin Schmidt, Felix Geyer, Stefan Fröse", - author_email="kevin3.schmidt@tu-dortmund.de", - license="MIT", - include_package_data=True, - packages=find_packages(), - install_requires=[ - "numpy", - "astropy", - "matplotlib", - "ipython", - "scipy", - "pandas", - "toml", - "pytest", - "pytest-cov", - "jupyter", - "astroplan", - "torch", - "tqdm", - "numexpr", - "click", - "h5py", - "natsort", - "pre-commit", - ], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - zip_safe=False, - entry_points={ - "console_scripts": [ - "pyvisgen_create_dataset = pyvisgen.simulation.scripts.create_dataset:main", - ], - }, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Scientific/Engineering :: Astronomy", - "Topic :: Scientific/Engineering :: Physics", - "Topic :: Scientific/Engineering :: Information Analysis", - ], -) From 7602687904da7bad5003296fd7206487cb67c232 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:42:42 +0200 Subject: [PATCH 14/26] add changelog --- docs/changes/35.maintenance.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changes/35.maintenance.rst diff --git a/docs/changes/35.maintenance.rst b/docs/changes/35.maintenance.rst new file mode 100644 index 0000000..598cc4f --- /dev/null +++ b/docs/changes/35.maintenance.rst @@ -0,0 +1 @@ +- switch from setup.py to pyproject.toml From 6495516e81c810362c10701c5c84a7f2fc2e25cc Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:44:19 +0200 Subject: [PATCH 15/26] add torch to dependencies --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1090f2f..0139550 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ requires-python = ">=3.10" dependencies = [ "numpy", "astropy<=6.1.0", + "pytorch", "matplotlib", "ipython", "scipy", From ddff3d2a8f773acb432e2cb8c3357f00d1636664 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:51:29 +0200 Subject: [PATCH 16/26] update ci workflow --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc84415..f382051 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: fetch-depth: 0 - name: Prepare mamba installation - if: matrix.install-method == 'mamba' + if: matrix.install-method == 'mamba' && contains(github.event.pull_request.labels.*.name, 'documentation-only') == false env: PYTHON_VERSION: ${{ matrix.python-version }} run: | @@ -47,8 +47,11 @@ jobs: sed -i -e "s/- python.*/- python=$PYTHON_VERSION/g" environment.yml - name: mamba setup - if: matrix.install-method == 'mamba' + if: matrix.install-method == 'mamba' && contains(github.event.pull_request.labels.*.name, 'documentation-only') == false uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environment.yml + cache-downloads: true - name: Install dependencies run: | From 26cfe7fa2dfccbb73173cc01a5f7833a583ba3e2 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:55:26 +0200 Subject: [PATCH 17/26] update environment --- environment.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 6e2c2d4..9011884 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ ---- +# A conda environment with all useful packages for pyvisgen developers name: pyvisgen channels: - pytorch @@ -6,9 +6,15 @@ channels: - conda-forge dependencies: - python + - astropy<=6.1.0 - pytorch - numpy + - matplotlib - pip + - towncrier + - jupyter + - pytest + - pytest-cov + - pytest-runner - pip: - - towncrier - -e . From 75d2d0c8ce6092a39156a31392096c51e6c6d0aa Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 14:56:05 +0200 Subject: [PATCH 18/26] del dynamic version --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0139550..13f7a6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ classifiers = [ "Development Status :: 4 - Beta", ] -dynamic = ["version"] requires-python = ">=3.10" dependencies = [ From 1307075ed733d7071907801487da7691bae21cfa Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 15:00:21 +0200 Subject: [PATCH 19/26] provide package dir --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 13f7a6c..6cb3035 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,9 @@ dependencies = [ [project.scripts] pyvisgen_create_dataset = "pyvisgen.simulation.scripts.create_dataset:main" +[tool.setuptools.packages.find] + where = ["pyvisgen"] + [tool.towncrier] package = "ctapipe" directory = "docs/changes" From b2558da0aec0419c7108bbb2295f3e307fa7975b Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 15:02:53 +0200 Subject: [PATCH 20/26] fix torch --- environment.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 9011884..1f6ca67 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ channels: dependencies: - python - astropy<=6.1.0 - - pytorch + - torch - numpy - matplotlib - pip diff --git a/pyproject.toml b/pyproject.toml index 6cb3035..8b0211f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ requires-python = ">=3.10" dependencies = [ "numpy", "astropy<=6.1.0", - "pytorch", + "torch", "matplotlib", "ipython", "scipy", From 87385eb814bf70452c373833267cd8a5ba407090 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 15:04:12 +0200 Subject: [PATCH 21/26] use pytorch for mamba --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 1f6ca67..9011884 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ channels: dependencies: - python - astropy<=6.1.0 - - torch + - pytorch - numpy - matplotlib - pip From c0a6c9dde12bc8630a7e2fd98cd0ce1ef3cdc5cf Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 15:10:47 +0200 Subject: [PATCH 22/26] fix workflow --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f382051..4910744 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,8 +57,9 @@ jobs: run: | python --version pip install pytest-cov restructuredtext-lint pytest-xdist 'coverage!=6.3.0' - pip install .[all] + pip install -e .[all] pip freeze + pip list - name: List installed package versions (conda) if: matrix.environment-type == 'mamba' @@ -66,7 +67,7 @@ jobs: - name: Tests run: | - py.test --cov --cov-report=xml + pytest --cov --cov-report=xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 From afc6c31d3982a35714c470545b5872bdba6a45de Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 15:14:53 +0200 Subject: [PATCH 23/26] delete installation --- environment.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/environment.yml b/environment.yml index 9011884..b62bdda 100644 --- a/environment.yml +++ b/environment.yml @@ -16,5 +16,3 @@ dependencies: - pytest - pytest-cov - pytest-runner - - pip: - - -e . From 43fdcef14275b4b807679e7f0ec2b8ed9f9a8689 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 15:21:28 +0200 Subject: [PATCH 24/26] add env info --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4910744..f6d9eb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,8 @@ jobs: cache-downloads: true - name: Install dependencies + env: + PYTHON_VERSION: ${{ matrix.python-version }} run: | python --version pip install pytest-cov restructuredtext-lint pytest-xdist 'coverage!=6.3.0' From 04f32d21d1b552b285cdcdcc0e95724dbb262e78 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Thu, 18 Jul 2024 15:32:10 +0200 Subject: [PATCH 25/26] add init in tests --- tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 From 79ddd58b58536bff8b3430fb441fbd23c4141654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Gro=C3=9F?= Date: Thu, 18 Jul 2024 15:57:48 +0200 Subject: [PATCH 26/26] Update visibility.py Change `use_tqdm` variable name to `show_progress` --- pyvisgen/simulation/visibility.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyvisgen/simulation/visibility.py b/pyvisgen/simulation/visibility.py index 4c4d754..492c9ae 100644 --- a/pyvisgen/simulation/visibility.py +++ b/pyvisgen/simulation/visibility.py @@ -39,7 +39,7 @@ def add(self, visibilities): ] -def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full", batch_size=100, use_tqdm=False): +def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full", batch_size=100, show_progress=False): torch.set_num_threads(num_threads) torch._dynamo.config.suppress_errors = True @@ -97,7 +97,7 @@ def vis_loop(obs, SI, num_threads=10, noisy=True, mode="full", batch_size=100, u batches = torch.arange(bas[:].shape[1]).split(batch_size) - if use_tqdm: + if show_progress: batches = tqdm(batches) for p in batches: @@ -170,4 +170,4 @@ def generate_noise(shape, obs, SEFD): noise = torch.normal(mean=0, std=std, size=shape, device=obs.device) noise = noise + 1.0j * torch.normal(mean=0, std=std, size=shape, device=obs.device) - return noise \ No newline at end of file + return noise