Skip to content

Commit 111fe6d

Browse files
committed
style: format the review fixes with black
1 parent df2e559 commit 111fe6d

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

‎loopstructural/main/model_manager.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,9 +1164,10 @@ def _model_area(self) -> float:
11641164
"""Return the map (XY) area of the model box, or 0 if the box is not set."""
11651165
bounding_box = getattr(self.model, 'bounding_box', None)
11661166
try:
1167-
lengths = np.asarray(bounding_box.maximum, dtype=float)[:2] - np.asarray(
1168-
bounding_box.origin, dtype=float
1169-
)[:2]
1167+
lengths = (
1168+
np.asarray(bounding_box.maximum, dtype=float)[:2]
1169+
- np.asarray(bounding_box.origin, dtype=float)[:2]
1170+
)
11701171
except (AttributeError, TypeError, ValueError, IndexError):
11711172
return 0.0
11721173
area = float(np.prod(lengths))
@@ -1431,9 +1432,7 @@ def _group_by_name(self, name):
14311432
def detached_to_dict(self) -> dict:
14321433
"""Return `detached` in a form that `json.dump` can write."""
14331434
return {
1434-
name: {
1435-
'columns': {str(c): [_json_value(v) for v in data[c]] for c in data.columns}
1436-
}
1435+
name: {'columns': {str(c): [_json_value(v) for v in data[c]] for c in data.columns}}
14371436
for name, data in self.detached.items()
14381437
}
14391438

@@ -1692,7 +1691,9 @@ def _build_parametric_faults(self):
16921691

16931692
def parametric_faults_to_dict(self) -> dict:
16941693
"""Return `parametric_faults` in a form that `json.dump` can write."""
1695-
return {name: parametric_fault.clean_spec(spec) for name, spec in self.parametric_faults.items()}
1694+
return {
1695+
name: parametric_fault.clean_spec(spec) for name, spec in self.parametric_faults.items()
1696+
}
16961697

16971698
def parametric_faults_from_dict(self, faults: dict):
16981699
"""Replace `parametric_faults` with the specs from `parametric_faults_to_dict`."""

‎loopstructural/main/parametric_fault.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,15 @@ def clean_spec(spec: dict) -> dict:
174174
"""Return the spec as plain numbers and text, safe for JSON."""
175175
result = {key: spec[key] for key in FIELDS if key in spec}
176176
result['name'] = str(result['name']).strip()
177-
for key in ('strike', 'dip', 'pitch', 'displacement', 'major_axis', 'intermediate_axis',
178-
'minor_axis'):
177+
for key in (
178+
'strike',
179+
'dip',
180+
'pitch',
181+
'displacement',
182+
'major_axis',
183+
'intermediate_axis',
184+
'minor_axis',
185+
):
179186
if key in result:
180187
result[key] = float(result[key])
181188
result['centre'] = [float(v) for v in result['centre']]

‎tests/unit/test_step_checks.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ def test_a_geographic_crs_is_a_problem(self, dm):
110110
class TestStratigraphyStep:
111111
@pytest.fixture(autouse=True)
112112
def map_layers(self, dm, request):
113-
if request.node.name not in ('test_an_empty_column_is_not_started', 'test_missing_map_layers_are_a_todo'):
113+
if request.node.name not in (
114+
'test_an_empty_column_is_not_started',
115+
'test_missing_map_layers_are_a_todo',
116+
):
114117
dm.layer_roles.values = {
115118
layer_roles.GEOLOGY: object(),
116119
layer_roles.STRUCTURE: object(),

0 commit comments

Comments
 (0)