Skip to content

Commit 3f4cfd5

Browse files
committed
style(pre-commit): apply style
1 parent 46a656b commit 3f4cfd5

22 files changed

+61
-49
lines changed

.github/workflows/package.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "Package"
22

33
on:
4-
workflow_dispatch: # manually triggered
4+
workflow_dispatch: # manually triggered
55
workflow_run:
66
workflows: ["Release"]
77
types: [completed]
@@ -17,12 +17,12 @@ jobs:
1717
include:
1818
- platform: "macos-latest" # for Arm based macs (M1 and above).
1919
args: "--target aarch64-apple-darwin"
20-
- platform: 'macos-latest' # for Intel based macs.
21-
args: '--target x86_64-apple-darwin'
22-
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
23-
args: ''
24-
- platform: 'windows-latest'
25-
args: ''
20+
- platform: "macos-latest" # for Intel based macs.
21+
args: "--target x86_64-apple-darwin"
22+
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
23+
args: ""
24+
- platform: "windows-latest"
25+
args: ""
2626
runs-on: ${{ matrix.platform }}
2727
steps:
2828
- uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Release"
22
on:
3-
workflow_dispatch: # manually triggered
3+
workflow_dispatch: # manually triggered
44

55
env:
66
# Many color libraries just need this to be set to any value, but at least

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/e3sm-quickview.svg)](https://anaconda.org/conda-forge/e3sm-quickview)
88

99
**EAM QuickView** is an open-source, interactive visualization tool
10-
designed for scientists working with the atmospheric component of the
11-
[Energy Exascale Earth System Model (E3SM)](https://e3sm.org/),
12-
known as the E3SM Atmosphere Model (EAM).
13-
Its Python- and [Trame](https://www.kitware.com/trame/)-based
10+
designed for scientists working with the atmospheric component of the
11+
[Energy Exascale Earth System Model (E3SM)](https://e3sm.org/),
12+
known as the E3SM Atmosphere Model (EAM).
13+
Its Python- and [Trame](https://www.kitware.com/trame/)-based
1414
Graphical User Interface (GUI) provides
15-
intuitive access to [ParaView](https://www.paraview.org/)'s
15+
intuitive access to [ParaView](https://www.paraview.org/)'s
1616
powerful analysis and visualization capabilities, without the steep learning curve.
1717

1818
![Application](https://raw.githubusercontent.com/Kitware/QuickView/master/QuickView-app.png)

pyproject.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ tauri = [
4040
jupyter = [
4141
"jupyter-server-proxy>=4.0.0",
4242
]
43-
43+
dev = [
44+
"pre-commit",
45+
"ruff",
46+
"pytest >=6",
47+
"pytest-asyncio",
48+
"pytest-cov >=3",
49+
]
4450

4551
[build-system]
4652
requires = ["hatchling"]
@@ -69,8 +75,8 @@ quickview = "e3sm_quickview.jupyter:setup_quickview"
6975

7076
[tool.ruff.lint.per-file-ignores]
7177
# Ignore star import issues in ParaView plugins
72-
"e3sm_quickview/plugins/*.py" = ["F403", "F405"]
73-
"e3sm_quickview/pipeline.py" = ["F821"] # Plugin classes loaded dynamically
78+
"src/e3sm_quickview/plugins/*.py" = ["F403", "F405"]
79+
"src/e3sm_quickview/pipeline.py" = ["F821"] # Plugin classes loaded dynamically
7480

7581
[tool.semantic_release]
7682
version_toml = [

src/e3sm_quickview/plugins/eam_projection.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from vtkmodules.numpy_interface import dataset_adapter as dsa
44
from vtkmodules.vtkCommonCore import (
55
vtkPoints,
6-
vtkIdList,
76
)
87
from vtkmodules.vtkCommonDataModel import (
98
vtkPolyData,
@@ -58,6 +57,7 @@ def ProcessPoint(point, radius):
5857
z = rho * math.cos(math.radians(phi))
5958
return [x, y, z]
6059

60+
6161
@smproxy.filter()
6262
@smproperty.input(name="Input")
6363
@smdomain.datatype(
@@ -412,9 +412,7 @@ def RequestData(self, request, inInfo, outInfo):
412412

413413
@smproxy.filter()
414414
@smproperty.input(name="Input")
415-
@smdomain.datatype(
416-
dataTypes=["vtkPolyData"], composite_data_supported=False
417-
)
415+
@smdomain.datatype(dataTypes=["vtkPolyData"], composite_data_supported=False)
418416
@smproperty.xml(
419417
"""
420418
<DoubleVectorProperty name="Longitude Range"
@@ -475,11 +473,10 @@ def RequestData(self, request, inInfo, outInfo):
475473
return 1
476474

477475

478-
479476
@smproxy.filter()
480477
@smproperty.input(name="Input")
481478
@smproperty.xml(
482-
"""
479+
"""
483480
<IntVectorProperty name="Meridian"
484481
command="SetMeridian"
485482
number_of_elements="1"
@@ -502,11 +499,12 @@ def RequestData(self, request, inInfo, outInfo):
502499
dataTypes=["vtkPolyData", "vtkUnstructuredGrid"], composite_data_supported=False
503500
)
504501
class EAMCenterMeridian(VTKPythonAlgorithmBase):
505-
'''Cuts an unstructured grid and re-arranges the pieces such that
502+
"""Cuts an unstructured grid and re-arranges the pieces such that
506503
the specified meridian is in the middle. Note that the mesh is
507504
specified with bounds [0, 360], but the meridian is specified in the more
508505
common bounds [-180, 180].
509-
'''
506+
"""
507+
510508
def __init__(self):
511509
super().__init__(
512510
nInputPorts=1, nOutputPorts=1, outputType="vtkUnstructuredGrid"
@@ -516,19 +514,23 @@ def __init__(self):
516514
self._cached_output = None
517515

518516
def SetMeridian(self, meridian_):
519-
'''
517+
"""
520518
Specifies the central meridian (longitude in the middle of the map)
521-
'''
519+
"""
522520
if meridian_ < -180 or meridian_ > 180:
523-
print_error("SetMeridian called with parameter outside [-180, 180]: {}".format(meridian_))
521+
print_error(
522+
"SetMeridian called with parameter outside [-180, 180]: {}".format(
523+
meridian_
524+
)
525+
)
524526
return
525527
self._center_meridian = meridian_
526528
self.Modified()
527529

528530
def GetMeridian(self):
529-
'''
531+
"""
530532
Returns the central meridian
531-
'''
533+
"""
532534
return self._center_meridian
533535

534536
def RequestData(self, request, inInfo, outInfo):
@@ -537,8 +539,11 @@ def RequestData(self, request, inInfo, outInfo):
537539
inCellArray = inData.GetCells()
538540

539541
outData = self.GetOutputData(outInfo, 0)
540-
if self._cached_output and self._cached_output.GetMTime() > inPoints.GetMTime() and \
541-
self._cached_output.GetMTime() > inCellArray.GetMTime():
542+
if (
543+
self._cached_output
544+
and self._cached_output.GetMTime() > inPoints.GetMTime()
545+
and self._cached_output.GetMTime() > inCellArray.GetMTime()
546+
):
542547
# only scalars have been added or removed
543548
cached_cell_data = self._cached_output.GetCellData()
544549

@@ -564,7 +569,9 @@ def RequestData(self, request, inInfo, outInfo):
564569
out_array.SetNumberOfTuples(array0.GetNumberOfTuples())
565570
out_array.SetName(in_array.GetName())
566571
out_cell_data.AddArray(out_array)
567-
outData.cell_data[out_array.GetName()] = inData.cell_data[i][self._cached_output.cell_data['PedigreeIds']]
572+
outData.cell_data[out_array.GetName()] = inData.cell_data[i][
573+
self._cached_output.cell_data["PedigreeIds"]
574+
]
568575
else:
569576
generate_ids = vtkGenerateIds()
570577
generate_ids.SetInputData(inData)

src/e3sm_quickview/plugins/eam_reader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ def _build_geometry(self, meshdata):
463463
lat = meshdata[latdim][:].data.flatten()
464464
lon = meshdata[londim][:].data.flatten()
465465

466-
467466
if self._ForceFloatPoints:
468467
points_type = np.float32
469468
else:

src/e3sm_quickview/presets/acton_PARAVIEW.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,4 @@
257257
<Point x="0.996078" o="1" r="0.938996" g="0.915599" b="0.976685"/>
258258
<Point x="1.000000" o="1" r="0.939858" g="0.919150" b="0.979353"/>
259259
</ColorMap>
260-
</ColorMaps>
260+
</ColorMaps>

src/e3sm_quickview/presets/bam_PARAVIEW.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,4 @@
257257
<Point x="0.996078" o="1" r="0.060124" g="0.303780" b="0.005140"/>
258258
<Point x="1.000000" o="1" r="0.049098" g="0.296663" b="0.000000"/>
259259
</ColorMap>
260-
</ColorMaps>
260+
</ColorMaps>

src/e3sm_quickview/presets/batlow_PARAVIEW.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,4 @@
257257
<Point x="0.996078" o="1" r="0.982048" g="0.797228" b="0.972070"/>
258258
<Point x="1.000000" o="1" r="0.981354" g="0.800406" b="0.981267"/>
259259
</ColorMap>
260-
</ColorMaps>
260+
</ColorMaps>

src/e3sm_quickview/presets/berlin_PARAVIEW.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,4 @@
257257
<Point x="0.996078" o="1" r="0.991448" g="0.671939" b="0.670216"/>
258258
<Point x="1.000000" o="1" r="0.999873" g="0.680072" b="0.679950"/>
259259
</ColorMap>
260-
</ColorMaps>
260+
</ColorMaps>

0 commit comments

Comments
 (0)