Skip to content

Commit

Permalink
dev: Fix some long line CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adigitoleo committed Aug 3, 2023
1 parent 7c27e4b commit 792d699
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ exclude = [
".vtu",
]
[tool.ruff.per-file-ignores]
"src/pydrex/__init__.py" = ["F401"] # Don't complain about unused imports in __init__.py file.
"src/pydrex/__init__.py" = ["F401", "E501"] # Don't complain about unused imports or long lines in __init__.py file.
"tests/" = ["E501"] # Don't complain about long lines in test files.
2 changes: 1 addition & 1 deletion src/pydrex/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def finite_strain(deformation_gradient, **kwargs):


def symmetry(orientations, axis="a"):
r"""Compute texture symmetry eigenvalue diagnostics from olivine orientation matrices.
r"""Compute texture symmetry eigenvalue diagnostics from grain orientation matrices.
Compute Point, Girdle and Random symmetry diagnostics
for ternary texture classification.
Expand Down
26 changes: 17 additions & 9 deletions src/pydrex/minerals.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"""Stiffness tensor for olivine (Voigt representation), with units of GPa.
The source of the values used here is unknown, but they are copied
from the original DRex code: <http://www.ipgp.fr/~kaminski/web_doudoud/DRex.tar.gz> [88K download]
from the original DRex code: <http://www.ipgp.fr/~kaminski/web_doudoud/DRex.tar.gz>
[88K download]
"""

Expand All @@ -45,7 +46,8 @@
"""Stiffness tensor for enstatite (Voigt representation), with units of GPa.
The source of the values used here is unknown, but they are copied
from the original DRex code: <http://www.ipgp.fr/~kaminski/web_doudoud/DRex.tar.gz> [88K download]
from the original DRex code: <http://www.ipgp.fr/~kaminski/web_doudoud/DRex.tar.gz>
[88K download]
"""

Expand Down Expand Up @@ -83,7 +85,8 @@ def voigt_averages(minerals, weights):
- `minerals` — list of `pydrex.minerals.Mineral` instances storing orientations and
fractional volumes of the grains within each distinct mineral phase
- `weights` (dict) — dictionary containing weights of each mineral
phase, as a fraction of 1, in keys named "<phase>_fraction", e.g. "olivine_fraction"
phase, as a fraction of 1, in keys named "<phase>_fraction",
e.g. "olivine_fraction"
Raises a ValueError if the minerals contain an unequal number of grains or stored
texture results.
Expand Down Expand Up @@ -176,7 +179,7 @@ class Mineral:
>>> regime=pydrex.DeformationRegime.dislocation,
>>> n_grains=2000,
>>> )
Mineral(phase=0, fabric=0, regime=1, n_grains=2000, fractions=<list of ndarray (2000,)>, orientations=<list of ndarray (2000, 3, 3)>)
Mineral(phase=0, fabric=0, regime=1, n_grains=2000, ...)
Mineral with specified initial texture and default phase, fabric and regime settings
which are for an olivine A-type mineral in the dislocation creep regime.
Expand All @@ -190,18 +193,22 @@ class Mineral:
>>> n_grains=n_grains,
>>> fractions_init=np.full(n_grains, 1 / n_grains),
>>> orientations_init=Rotation.from_euler(
>>> "zxz", [[x * np.pi / 2, np.pi / /2, np.pi / 2] for x in rng.random(n_grains)]
>>> "zxz", [
>>> [x * np.pi / 2, np.pi / /2, np.pi / 2] for x in rng.random(n_grains)
>>> ]
>>> ).inv().as_matrix(),
>>> )
Mineral(phase=0, fabric=0, regime=1, n_grains=2000, fractions=<list of ndarray (2000,)>, orientations=<list of ndarray (2000, 3, 3)>)
Mineral(phase=0, fabric=0, regime=1, n_grains=2000, ...)
**Attributes:**
- `phase` (`pydrex.core.MineralPhase`) — ordinal number of the mineral phase
- `fabric` (`pydrex.core.MineralFabric`) — ordinal number of the fabric type
- `regime` (`pydrex.core.DeformationRegime`) — ordinal number of the deformation regime
- `regime` (`pydrex.core.DeformationRegime`) — ordinal number of the deformation
regime
- `n_grains` (int) — number of grains in the aggregate
- `fractions` (list of arrays) — grain volume fractions for each texture snapshot
- `orientations` (list of arrays) — grain orientation matrices for each texture snapshot
- `orientations` (list of arrays) — grain orientation matrices for each texture
snapshot
- `seed` (`int`) — seed used by the random number generator to set up the isotropic
initial condition when `fractions_init` or `orientations_init` are not provided
Expand Down Expand Up @@ -241,7 +248,8 @@ def __str__(self):
+ f"fractions=<{self.fractions.__class__.__qualname__}"
+ f" of {self.fractions[0].__class__.__qualname__} {shape_of_fractions}>, "
+ f"orientations=<{self.orientations.__class__.__qualname__}"
+ f" of {self.orientations[0].__class__.__qualname__} {shape_of_orientations}>)"
+ f" of {self.orientations[0].__class__.__qualname__}"
+ f" {shape_of_orientations}>)"
)

def _repr_pretty_(self, p, cycle):
Expand Down
3 changes: 2 additions & 1 deletion src/pydrex/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def point_density(
- `gridsteps` (int) — the number of steps, i.e. number of points along a diameter of
the spherical counting grid
- `weights` (array) — auxiliary weights for each data point
- `kernel` (string) — the name of the kernel function to use, see `SPHERICAL_COUNTING_KERNELS`
- `kernel` (string) — the name of the kernel function to use, see
`SPHERICAL_COUNTING_KERNELS`
- `axial` (bool) — toggle axial versions of the kernel functions
(for crystallographic data this should normally be kept as `True`)
Expand Down

0 comments on commit 792d699

Please sign in to comment.