Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code formatting changes to comply with black v24.1 #1257

Merged
merged 5 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ default_stages: [commit]

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.1.0
hooks:
- id: black

- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
# - repo: https://github.com/timothycrosley/isort
# rev: 5.13.2
# hooks:
# - id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/chemistry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
attributes used by the `PySDM.dynamics.aqueous_chemistry` dynamic
"""

from .acidity import Acidity
from .concentration import make_concentration_factory
from .hydrogen_ion_concentration import HydrogenIonConcentration
1 change: 1 addition & 0 deletions PySDM/attributes/chemistry/acidity.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
pH calculated by finding equilibrium hydrogen ion concentration
"""

from PySDM.attributes.impl.intensive_attribute import DerivedAttribute
from PySDM.backends.impl_numba.methods.chemistry_methods import _conc
from PySDM.dynamics.impl.chemistry_utils import AQUEOUS_COMPOUNDS
Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/chemistry/concentration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
concentrations (intensive, derived attributes)
"""

from PySDM.attributes.impl.intensive_attribute import IntensiveAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/chemistry/hydrogen_ion_concentration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
hydrogen ion concentration derived from pH
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/ice/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
attributes used by the `PySDM.dynamics.freezing.Freezing` dynamic
"""

from .cooling_rate import CoolingRate
from .freezing_temperature import FreezingTemperature
from .immersed_surface_area import ImmersedSurfaceArea
1 change: 1 addition & 0 deletions PySDM/attributes/ice/cooling_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
temperatures divided by the timestep (i.e. equals zero if particle has not
moved to a different cell since the last timestep)
"""

import numpy as np

from PySDM.attributes.impl import DerivedAttribute
Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/ice/freezing_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
particle freezing temperature (assigned at initialisation, modified through collisions only,
used in singular regime)
"""

from PySDM.attributes.impl import MaximumAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/ice/immersed_surface_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
immersed INP surface area (assigned at initialisation, modified through collisions only,
used in time-dependent regime)
"""

from ..impl import ExtensiveAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
common code intended for use from within attribute classes (not in user code)
"""

from .attribute import Attribute
from .base_attribute import BaseAttribute
from .cell_attribute import CellAttribute
Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/base_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
logic around `PySDM.attributes.impl.base_attribute.BaseAttribute` - the parent class
for non-derived attributes
"""

from .attribute import Attribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/cell_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
logic around `PySDM.attributes.impl.cell_attribute.CellAttribute` - the parent class
for grid-particle mapping attributes
"""

from .base_attribute import BaseAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/derived_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
logic around `PySDM.attributes.impl.derived_attribute.DerivedAttribute` - the parent class
for all derived attributes
"""

from .attribute import Attribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/dummy_attribute.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" logic around `PySDM.attributes.impl.dummy_attribute.DummyAttribute` - parent class
for do-nothing attributes """

import warnings

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/extensive_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
logic around `PySDM.attributes.impl.extensive_attribute.ExtensiveAttribute` - parent class
for all extensive attributes
"""

from .base_attribute import BaseAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/intensive_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
logic around `PySDM.attributes.impl.intensive_attribute.IntensiveAttribute` - parent class
for all intensive attributes
"""

from .derived_attribute import DerivedAttribute


Expand Down
7 changes: 4 additions & 3 deletions PySDM/attributes/impl/mapper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
attribute name-class mapping logic (each new attribute must be added here)
"""

from functools import partial

from PySDM.attributes.chemistry import (
Expand Down Expand Up @@ -54,9 +55,9 @@
and formulae.surface_tension.__name__ == Constant.__name__
else DryVolumeOrganic
),
"dry volume": lambda dynamics, formulae: DryVolumeDynamic
if "AqueousChemistry" in dynamics
else DryVolume,
"dry volume": lambda dynamics, formulae: (
DryVolumeDynamic if "AqueousChemistry" in dynamics else DryVolume
),
"dry volume organic fraction": lambda dynamics, formulae: (
make_dummy_attribute_factory("dry volume organic fraction")
if "Condensation" in dynamics
Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/maximum_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
value is set to maximum of values of colliding particle (e.g., freezing temperature
in singular immersion freezing)
"""

from .base_attribute import BaseAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/impl/mole_amount.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
mole amounts (extensive, base attributes)
"""

from PySDM.attributes.impl.extensive_attribute import ExtensiveAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/isotopes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""
isotopic fractionation related attributes
"""

from .moles_light_isotopes import Moles1H, Moles16O, MolesLightWater
1 change: 1 addition & 0 deletions PySDM/attributes/isotopes/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
per-droplet isotopic ratio of heavy-to-light isotope number concentrations
expressed vs the VSMOW reference in SI units (i.e., not per mille)
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/isotopes/moles_light_isotopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
moles_1H = 2 * (moles_H2O + moles_17O + moles_18O) + moles_2H + moles_3H
moles_16O = .5 * (moles_2H + moles_3H) + moles_H2O
"""

from PySDM.attributes.impl import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/numerics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
attributes used for tracking cell-particle mapping in multi-dimensional simulations
"""

from .cell_id import CellID
from .cell_origin import CellOrigin
from .position_in_cell import PositionInCell
1 change: 1 addition & 0 deletions PySDM/attributes/numerics/cell_id.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
grid cell id attribute
"""

from PySDM.attributes.impl.cell_attribute import CellAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/numerics/cell_origin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
grid-cell origin (multi-dimensional)
"""

from PySDM.attributes.impl.cell_attribute import CellAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/numerics/position_in_cell.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
position-within-cell attribute (multi-dimensional, values normalised to one)
"""

from PySDM.attributes.impl.cell_attribute import CellAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
attributes carrying information on particle physical properties
"""

from .area import Area
from .critical_supersaturation import CriticalSupersaturation
from .critical_volume import CriticalVolume, WetToCriticalVolumeRatio
Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/area.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
particle wet radius (calculated from the volume)
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/critical_supersaturation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
kappa-Koehler critical supersaturation calculated for actual environment temperature
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/critical_volume.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
critical wet volume (kappa-Koehler, computed using actual temperature)
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/dry_radius.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
particle dry radius computed from dry volume
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/dry_volume.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
particle dry volume (subject to evolution due to collisions or aqueous chemistry)
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute
from PySDM.attributes.impl.extensive_attribute import ExtensiveAttribute

Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/equilibrium_supersaturation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
kappa-Koehler equilibrium supersaturation calculated for actual environment temperature
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/heat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
particle heat content (test-use only for now, exemplifying intensive/extensive attribute logic)
"""

from PySDM.attributes.impl.extensive_attribute import ExtensiveAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/hygroscopicity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
the `PySDM.attributes.physics.hygroscopicity.KappaTimesDryVolume` base attribute
and the derived `PySDM.attributes.physics.hygroscopicity.Kappa` attribute
"""

from ..impl.derived_attribute import DerivedAttribute
from ..impl.extensive_attribute import ExtensiveAttribute

Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
in simulation involving mixed-phase clouds, positive values correspond to
liquid water and negative values to ice
"""

from PySDM.attributes.impl import ExtensiveAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/multiplicities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
super-particle multiplicity (aka weighting factor) - the number of real-world particles
represented in the simulation with a given super particle
"""

import numpy as np

from PySDM.attributes.impl.base_attribute import BaseAttribute
Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/radius.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
particle wet radius (calculated from the volume)
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/temperature.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
particle temperature (test-use only for now, exemplifying intensive/extensive attribute logic)
"""

from PySDM.attributes.impl.intensive_attribute import IntensiveAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/terminal_velocity.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
particle terminal velocity (used for collision probability and particle displacement)
"""

from PySDM.attributes.impl.derived_attribute import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/attributes/physics/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
in simulation involving mixed-phase clouds, positive values correspond to
liquid water and negative values to ice
"""

from PySDM.attributes.impl import DerivedAttribute


Expand Down
1 change: 1 addition & 0 deletions PySDM/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Backend classes: CPU=`PySDM.backends.numba.Numba`
and GPU=`PySDM.backends.thrust_rtc.ThrustRTC`
"""

import ctypes
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions PySDM/backends/impl_common/freezing_attributes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
groups of attributes used in either singular or time-dependent immmersion freezing regimes
"""

from collections import namedtuple


Expand Down
1 change: 1 addition & 0 deletions PySDM/backends/impl_common/index.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
permutation-defining Index class (can be shared between multiple IndexedStorage instances)
"""

import numpy as np

from .storage_utils import StorageSignature
Expand Down
1 change: 1 addition & 0 deletions PySDM/backends/impl_common/indexed_storage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
attribute storage class featuring particle permutation logic
"""

from .storage_utils import StorageSignature


Expand Down
1 change: 0 additions & 1 deletion PySDM/backends/impl_common/storage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
common code for storage classes
"""


from abc import abstractmethod
from collections import namedtuple
from typing import Type
Expand Down
Loading
Loading