Skip to content

Commit

Permalink
Fix incorrect import now that particle datasets have been renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
JBorrow committed Sep 19, 2024
1 parent 66ea952 commit d184d0b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions swiftsimio/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
+ SWIFTUnits, which is a unit system that can be queried for units (and converts arrays
to relevant unyt arrays when read from the HDF5 file)
+ SWIFTMetadata, which contains all of the metadata from the file
+ __SWIFTGroupDatasets, which contains particle information but should never be
+ __SWIFTGroupDataset, which contains particle information but should never be
directly accessed. Use generate_dataset to create one of these. The reasoning
here is that properties can only be added to the class afterwards, and not
directly in an _instance_ of the class.
Expand Down Expand Up @@ -250,7 +250,7 @@ def deleter(self):
return deleter


class __SWIFTGroupDatasets(object):
class __SWIFTGroupDataset(object):
"""
Creates empty property fields
Expand Down Expand Up @@ -435,7 +435,7 @@ def generate_datasets(group_metadata: SWIFTGroupMetadata, mask):
# for different particle types. We initially fill a dict with the properties that
# we want, and then create a single instance of our class.

this_dataset_bases = (__SWIFTGroupDatasets, object)
this_dataset_bases = (__SWIFTGroupDataset, object)
this_dataset_dict = {}

for (
Expand Down
4 changes: 2 additions & 2 deletions swiftsimio/visualisation/power_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from swiftsimio.optional_packages import tqdm
from swiftsimio.accelerated import jit, NUM_THREADS, prange
from swiftsimio import cosmo_array
from swiftsimio.reader import __SWIFTGroupDatasets
from swiftsimio.reader import __SWIFTGroupDataset

from typing import Optional, Dict, Tuple

Expand Down Expand Up @@ -169,7 +169,7 @@ def deposit_parallel(


def render_to_deposit(
data: __SWIFTGroupDatasets,
data: __SWIFTGroupDataset,
resolution: int,
project: str = "masses",
folding: int = 0,
Expand Down
6 changes: 3 additions & 3 deletions swiftsimio/visualisation/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from unyt import unyt_array, unyt_quantity, exceptions
from swiftsimio import SWIFTDataset, cosmo_array

from swiftsimio.reader import __SWIFTGroupDatasets
from swiftsimio.reader import __SWIFTGroupDataset
from swiftsimio.accelerated import jit, NUM_THREADS, prange

from swiftsimio.visualisation.projection_backends import backends, backends_parallel
Expand All @@ -42,7 +42,7 @@


def project_pixel_grid(
data: __SWIFTGroupDatasets,
data: __SWIFTGroupDataset,
boxsize: unyt_array,
resolution: int,
project: Union[str, None] = "masses",
Expand All @@ -65,7 +65,7 @@ def project_pixel_grid(
Parameters
----------
data: __SWIFTGroupDatasets
data: __SWIFTGroupDataset
The SWIFT dataset that you wish to visualise (get this from ``load``)
boxsize: unyt_array
Expand Down
4 changes: 2 additions & 2 deletions swiftsimio/visualisation/ray_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import math

from swiftsimio.objects import cosmo_array
from swiftsimio.reader import __SWIFTParticleDataset, SWIFTDataset
from swiftsimio.reader import __SWIFTGroupDataset, SWIFTDataset
from swiftsimio.visualisation.projection_backends.kernels import (
kernel_gamma,
kernel_double_precision as kernel,
Expand Down Expand Up @@ -216,7 +216,7 @@ def core_panels_parallel(


def panel_pixel_grid(
data: __SWIFTParticleDataset,
data: __SWIFTGroupDataset,
boxsize: unyt.unyt_array,
resolution: int,
panels: int,
Expand Down

0 comments on commit d184d0b

Please sign in to comment.