Skip to content

Commit 2d4de89

Browse files
committed
minor update on format
Signed-off-by: Yiyu Ni <[email protected]>
1 parent 07278ae commit 2d4de89

File tree

3 files changed

+7
-127
lines changed

3 files changed

+7
-127
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ dask-worker-space/
139139

140140
# tmp directory
141141
tmp/
142+
dev/
142143

143144
# Mac OS
144145
.DS_Store

.pre-commit-config.yaml

Lines changed: 0 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -31,124 +31,3 @@ repos:
3131
rev: 23.7.0
3232
hooks:
3333
- id: black
34-
35-
36-
# - repo: https://github.com/PyCQA/flake8
37-
# rev: 6.0.0
38-
# hooks:
39-
# - id: flake8
40-
# additional_dependencies:
41-
# - flake8-black
42-
# exclude: .git,__pycache__,build,dist
43-
# repos:
44-
45-
# # Compare the local template version to the latest remote template version
46-
# # This hook should always pass. It will print a message if the local version
47-
# # is out of date.
48-
# - repo: https://github.com/lincc-frameworks/pre-commit-hooks
49-
# rev: v0.1.1
50-
# hooks:
51-
# - id: check-lincc-frameworks-template-version
52-
# name: Check template version
53-
# description: Compare current template version against latest
54-
# verbose: true
55-
56-
# # Clear output from jupyter notebooks so that only the input cells are committed.
57-
# - repo: local
58-
# hooks:
59-
# - id: jupyter-nb-clear-output
60-
# name: Clear output from Jupyter notebooks
61-
# description: Clear output from Jupyter notebooks.
62-
# files: \.ipynb$
63-
# stages: [commit]
64-
# language: system
65-
# entry: jupyter nbconvert --clear-output
66-
67-
# # Prevents committing directly branches named 'main' and 'master'.
68-
# - repo: https://github.com/pre-commit/pre-commit-hooks
69-
# rev: v4.4.0
70-
# hooks:
71-
# - id: no-commit-to-branch
72-
# name: Prevent main branch commits
73-
# description: Prevent the user from committing directly to the primary branch.
74-
# - id: check-added-large-files
75-
# name: Check for large files
76-
# description: Prevent the user from committing very large files.
77-
# args: ['--maxkb=500']
78-
79-
# # Verify that pyproject.toml is well formed
80-
# - repo: https://github.com/abravalheri/validate-pyproject
81-
# rev: v0.12.1
82-
# hooks:
83-
# - id: validate-pyproject
84-
# name: Validate pyproject.toml
85-
# description: Verify that pyproject.toml adheres to the established schema.
86-
87-
88-
# # Automatically sort the imports used in .py files
89-
# - repo: https://github.com/pycqa/isort
90-
# rev: 5.12.0
91-
# hooks:
92-
# - id: isort
93-
# name: Run isort
94-
# description: Sort and organize imports in .py and .pyi files.
95-
# types_or: [python, pyi]
96-
97-
98-
99-
# # Analyze the code style and report code that doesn't adhere.
100-
# - repo: https://github.com/psf/black
101-
# rev: 23.7.0
102-
# hooks:
103-
# - id: black-jupyter
104-
# name: Format code using black
105-
# types_or: [python, pyi, jupyter]
106-
# # It is recommended to specify the latest version of Python
107-
# # supported by your project here, or alternatively use
108-
# # pre-commit's default_language_version, see
109-
# # https://pre-commit.com/#top_level-default_language_version
110-
# language_version: python3.10
111-
112-
113-
114-
115-
# # Run unit tests, verify that they pass. Note that coverage is run against
116-
# # the ./src directory here because that is what will be committed. In the
117-
# # github workflow script, the coverage is run against the installed package
118-
# # and uploaded to Codecov by calling pytest like so:
119-
# # `python -m pytest --cov=<package_name> --cov-report=xml`
120-
# - repo: local
121-
# hooks:
122-
# - id: pytest-check
123-
# name: Run unit tests
124-
# description: Run unit tests with pytest.
125-
# entry: bash -c "if python -m pytest --co -qq; then python -m pytest --cov=./src --cov-report=html; fi"
126-
# language: system
127-
# pass_filenames: false
128-
# always_run: true
129-
# # Make sure Sphinx can build the documentation while explicitly omitting
130-
# # notebooks from the docs, so users don't have to wait through the execution
131-
# # of each notebook or each commit. By default, these will be checked in the
132-
# # GitHub workflows.
133-
# - repo: local
134-
# hooks:
135-
# - id: sphinx-build
136-
# name: Build documentation with Sphinx
137-
# entry: sphinx-build
138-
# language: system
139-
# always_run: true
140-
# exclude_types: [file, symlink]
141-
# args:
142-
# [
143-
# "-M", # Run sphinx in make mode, so we can use -D flag later
144-
# # Note: -M requires next 3 args to be builder, source, output
145-
# "html", # Specify builder
146-
# "./docs", # Source directory of documents
147-
# "./_readthedocs", # Output directory for rendered documents
148-
# "-T", # Show full trace back on exception
149-
# "-E", # Don't use saved env; always read all files
150-
# "-d", # Flag for cached environment and doctrees
151-
# "./docs/_build/doctrees", # Directory
152-
# "-D", # Flag to override settings in conf.py
153-
# "exclude_patterns=notebooks/*", # Exclude our notebooks from pre-commit
154-
# ]

src/noisepy/seis/io/channelcatalog.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ def get_inventory(self, timespan: DateTimeRange, station: Station) -> obspy.Inve
188188
station = inventory.Station(sta, lat, lon, elevation, channels=channels)
189189
stations.append(station)
190190
nets.append(inventory.Network(net, stations))
191-
return inventory.Inventory(nets)
191+
return obspy.Inventory(nets)
192192

193193

194-
def sta_info_from_inv(inv: inventory.Inventory):
194+
def sta_info_from_inv(inv: obspy.Inventory):
195195
"""
196196
this function outputs station info from the obspy inventory object
197197
(used in S0B)
@@ -225,7 +225,7 @@ def sta_info_from_inv(inv: inventory.Inventory):
225225
return sta, net, lon, lat, elv, location
226226

227227

228-
def stats2inv_staxml(stats, respdir: str) -> inventory.Inventory:
228+
def stats2inv_staxml(stats, respdir: str) -> obspy.Inventory:
229229
if not respdir:
230230
raise ValueError("Abort! staxml is selected but no directory is given to access the files")
231231
else:
@@ -248,7 +248,7 @@ def stats2inv_staxml(stats, respdir: str) -> inventory.Inventory:
248248

249249

250250
def stats2inv_sac(stats):
251-
inv = inventory.Inventory(networks=[], source="homegrown")
251+
inv = obspy.Inventory(networks=[], source="homegrown")
252252
net = inventory.Network(
253253
# This is the network code according to the SEED standard.
254254
code=stats.network,
@@ -292,8 +292,8 @@ def stats2inv_sac(stats):
292292
return inv
293293

294294

295-
def stats2inv_mseed(stats, locs: pd.DataFrame) -> inventory.Inventory:
296-
inv = inventory.Inventory(networks=[], source="homegrown")
295+
def stats2inv_mseed(stats, locs: pd.DataFrame) -> obspy.Inventory:
296+
inv = obspy.Inventory(networks=[], source="homegrown")
297297
ista = locs[locs["station"] == stats.station].index.values.astype("int64")[0]
298298

299299
net = inventory.Network(

0 commit comments

Comments
 (0)