From e00a552e82387cc6b1e803d2818a30e4c14f2784 Mon Sep 17 00:00:00 2001 From: Kyle Oman Date: Wed, 9 Oct 2024 17:53:13 +0100 Subject: [PATCH 1/4] Autoformat. --- examples/SWIFTGalaxy_Colibre_QuickStart.ipynb | 5 +++-- optional_requirements.txt | 2 +- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/SWIFTGalaxy_Colibre_QuickStart.ipynb b/examples/SWIFTGalaxy_Colibre_QuickStart.ipynb index 8d26bfb..48ada8c 100644 --- a/examples/SWIFTGalaxy_Colibre_QuickStart.ipynb +++ b/examples/SWIFTGalaxy_Colibre_QuickStart.ipynb @@ -264,7 +264,8 @@ "source": [ "for ptype in \"gas\", \"dark_matter\", \"stars\":\n", " getattr(sg, ptype).smoothing_length = generate_smoothing_lengths(\n", - " (getattr(sg, ptype).coordinates + sg.centre) % sg.metadata.boxsize, # modified to wrap the box\n", + " (getattr(sg, ptype).coordinates + sg.centre)\n", + " % sg.metadata.boxsize, # modified to wrap the box\n", " sg.metadata.boxsize,\n", " kernel_gamma=1.8,\n", " neighbours=57,\n", @@ -623,7 +624,7 @@ " # no particles of this type\n", " print(f\"no {ptype}\")\n", " myvis(sg, fignum=figcounter)\n", - " figcounter += 1\n" + " figcounter += 1" ] } ], diff --git a/optional_requirements.txt b/optional_requirements.txt index 32229d5..f03afeb 100644 --- a/optional_requirements.txt +++ b/optional_requirements.txt @@ -1,5 +1,5 @@ pytest black[jupyter] wily -git+https://github.com/kyleaoman/velociraptor-python.git@load_fof_catalogues +velociraptor-python.git git+https://github.com/dnarayanan/caesar.git diff --git a/requirements.txt b/requirements.txt index dd1fce1..176db0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ numpy scipy h5py unyt -git+https://github.com/SWIFTSIM/swiftsimio.git +swiftsimio astropy From eb0c4e702e8492818b4ea9427c31fe70a66d7d9d Mon Sep 17 00:00:00 2001 From: Kyle Oman Date: Wed, 9 Oct 2024 19:51:52 +0100 Subject: [PATCH 2/4] Remove spurious .git --- optional_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optional_requirements.txt b/optional_requirements.txt index f03afeb..c11549a 100644 --- a/optional_requirements.txt +++ b/optional_requirements.txt @@ -1,5 +1,5 @@ pytest black[jupyter] wily -velociraptor-python.git +velociraptor-python git+https://github.com/dnarayanan/caesar.git From 153925bf61c3602acc007b5069ee11019ba920ee Mon Sep 17 00:00:00 2001 From: Kyle Oman Date: Wed, 9 Oct 2024 19:58:57 +0100 Subject: [PATCH 3/4] velociraptor, not velociraptor-python --- optional_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optional_requirements.txt b/optional_requirements.txt index c11549a..ebe5d6d 100644 --- a/optional_requirements.txt +++ b/optional_requirements.txt @@ -1,5 +1,5 @@ pytest black[jupyter] wily -velociraptor-python +velociraptor git+https://github.com/dnarayanan/caesar.git From 4386368eed97b4d1bd0f738fa1ef25c48bfbc816 Mon Sep 17 00:00:00 2001 From: Kyle Oman Date: Wed, 9 Oct 2024 20:13:03 +0100 Subject: [PATCH 4/4] Remove warnings about dev branch of swiftsimio from docs. --- README.rst | 5 ----- docs/source/halo_catalogues/index.rst | 5 ----- 2 files changed, 10 deletions(-) diff --git a/README.rst b/README.rst index 2a1d14d..33d1f81 100644 --- a/README.rst +++ b/README.rst @@ -14,15 +14,10 @@ SWIFTGalaxy SWIFTGalaxy is a module that extends SWIFTSimIO_ tailored to analyses of particles belonging to individual simulated galaxies. It inherits from and extends the functionality of the ``SWIFTDataset``. It understands the content of halo catalogues (supported: `Velociraptor`_, `Caesar`_, `SOAP`_) and therefore which particles belong to a galaxy or other group of particles, and its integrated properties. The particles occupy a coordinate frame that is enforced to be consistent, such that particles loaded on-the-fly will match e.g. rotations and translations of particles already in memory. Intuitive masking of particle datasets is also enabled. Finally, some utilities to make working in cylindrical and spherical coordinate systems more convenient are also provided. -.. warning:: - - In order to support use of SOAP halo catalogues this version (1.1.0) of SWIFTGalaxy depends on the `load_fof_catalogues`_ branch of SWIFTSimIO. This dependency will be automatically handled by ``pip``, but to use SOAP catalogues in SWIFTGalaxy you **must** install from github. One way to do this is ``pip install git+https://github.com/SWIFTSIM/swiftgalaxy.git``. PyPI_ does not allow depending on github repositories so SWIFTGalaxy v1.1.0 will not be released on PyPI (and therefore cannot be installed with ``pip install swiftgalaxy``) until the load_fof_catalogues branch is merged into SWIFTSimIO and itself released on PyPI. You can use the PyPI versions of both SWIFTGalaxy and SWIFTSimIO (these are compatible) but in this case SOAP halo catalogues are not supported. - .. _SWIFTSimIO: http://swiftsimio.readthedocs.org .. _Velociraptor: https://ui.adsabs.harvard.edu/abs/2019PASA...36...21E/abstract .. _Caesar: https://caesar.readthedocs.io/en/latest/ .. _SOAP: https://github.com/SWIFTSIM/SOAP -.. _load_fof_catalogues: https://github.com/SWIFTSIM/swiftsimio/tree/load_fof_catalogues .. _PyPI: https://pypi.org .. INTRO_END_LABEL diff --git a/docs/source/halo_catalogues/index.rst b/docs/source/halo_catalogues/index.rst index 87482ce..e0ece66 100644 --- a/docs/source/halo_catalogues/index.rst +++ b/docs/source/halo_catalogues/index.rst @@ -16,11 +16,6 @@ The `SOAP`_ catalogue format is the preferred catalogue format of the `SWIFT com .. _SWIFT community: https://github.com/SWIFTSIM .. _SOAP: https://github.com/SWIFTSIM/SOAP -.. _load_fof_catalogues: https://github.com/SWIFTSIM/swiftsimio/tree/load_fof_catalogues - -.. warning :: - - At the time of writing :mod:`swiftsimio` support for reading SOAP catalogues is functional but still under active development. The ``master`` branch of the :mod:`swiftsimio` repository does not yet allow reading SOAP catalogues. To use :mod:`swiftgalaxy` with SOAP catalogues currently requires installing the `load_fof_catalogues`_ branch of :mod:`swiftsimio`. One way to do this is ``pip install git+https://github.com/SWIFTSIM/swiftsimio.git@load_fof_catalogues``. Setting up an instance of the helper class is straightforward. We'll assume a SOAP catalogue called :file:`halo_properties_0123.hdf5`, and suppose that we're interested in the first object in the catalogue (row ``0``):