Skip to content
Snippets Groups Projects
Commit 4d76da16 authored by Omid Hosseini's avatar Omid Hosseini
Browse files

Merge branch 'i63-fix-linting-nexus' into '63-clean-nexus-s-codebase'

fix linting nexus module

See merge request !43
parents d0f71ab1 2e1b4d73
No related branches found
No related tags found
2 merge requests!46Draft: Resolve "Clean Nexus's codebase",!43fix linting nexus module
package:
name: nexus-passoft
version: "2023.4.6.2"
version: "2023.4.6.3"
source:
path: ../
......@@ -17,6 +17,7 @@ requirements:
build:
- python >=3.9
- pip
- setuptools
run:
- python >=3.9
......
......@@ -4,4 +4,4 @@
__author__ = """IRIS PASSCAL"""
__email__ = 'software-support@passcal.nmt.edu'
__version__ = '2023.4.6.2'
__version__ = '2023.4.6.3'
This diff is collapsed.
......@@ -15,6 +15,7 @@ from obspy import Inventory
from obspy import UTCDateTime
from obspy.core.inventory import (Network, Station, Channel,
Site, Equipment)
from obspy.core.inventory.util import Comment
from obspy.io.mseed.core import _is_mseed
from obspy.io.mseed import util
......@@ -298,6 +299,9 @@ class InventoryIm(Inventory):
inv_cha = inv_sta.channels[inv_sta.channels.index(inv_cha)]
if self.extend_epoch(inv_cha, start, end):
inv_cha._new = new
# add Comment object to Channel
comment = Comment('')
inv_cha.comments.append(comment)
def extend_epoch(self, inv, start: UTCDateTime, end: UTCDateTime) -> bool:
"""
......@@ -386,6 +390,7 @@ class InventoryIm(Inventory):
return True
return False
def populate_from_streams_old(self, streams, new=False):
"""
Deprecated.
......@@ -847,3 +852,31 @@ def utc_from_str(value: str) -> UTCDateTime:
hour=hour, minute=minute,
second=second, microsecond=microsecond
)
def scan_ms(dir_name, status_message=print):
# Remove timing test
import time
start = time.time()
mseed_files = []
streams = []
for root, dirs, files in os.walk(dir_name):
for name in files:
abs_path = os.path.join(root, name)
status_message('Scanning {}...'.format(abs_path))
if ( os.path.isfile(abs_path) and
_is_mseed(abs_path) ):
mseed_files.append(abs_path)
try:
st = obspy_read(abs_path, headonly=True)
except:
print('Failed to read file {}'.format(abs_path))
streams.append(st)
print(f'Scan took: {time.time() - start}')
return streams, mseed_files
def quick_scan_ms(dir_name, status_message=print):
import time
start = time.time()
print(f'Scan took: {time.time() - start}')
\ No newline at end of file
[bumpversion]
current_version = 2023.4.0.0
current_version = 2023.4.6.3
commit = True
tag = True
......
......@@ -52,6 +52,6 @@ setup(
packages=find_packages(include=['nexus']),
test_suite='tests',
url='https://git.passcal.nmt.edu/software_public/passoft/nexus',
version='2023.4.6.2',
version='2023.4.6.3',
zip_safe=False,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment