Skip to content

Commit 0b944cd

Browse files
samuelbray32edeno
andauthored
Make use of waveforms_dir consistent (#857)
* make use of waveforms_dir consistent * update changelog --------- Co-authored-by: Eric Denovellis <[email protected]>
1 parent 647a5f8 commit 0b944cd

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Infrastructure
66

77
- Add user roles to `database_settings.py`. #832
8+
- Fix redundancy in `waveforms_dir` #857
89
- Revise `dj_chains` to permit undirected paths for paths with multiple Merge
910
Tables. #846
1011

src/spyglass/decoding/v0/clusterless.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import spikeinterface as si
2222
import xarray as xr
2323

24-
from spyglass.settings import waveform_dir
24+
from spyglass.settings import waveforms_dir
2525
from spyglass.utils import logger
2626

2727
try:
@@ -157,7 +157,7 @@ def make(self, key):
157157
f'{key["curation_id"]}_clusterless_waveforms'
158158
)
159159
waveform_extractor_path = str(
160-
Path(waveform_dir) / Path(waveform_extractor_name)
160+
Path(waveforms_dir) / Path(waveform_extractor_name)
161161
)
162162
if os.path.exists(waveform_extractor_path):
163163
shutil.rmtree(waveform_extractor_path)

src/spyglass/settings.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,6 @@ def waveforms_dir(self) -> str:
509509
def temp_dir(self) -> str:
510510
return self.config.get(self.dir_to_var("temp"))
511511

512-
@property
513-
def waveform_dir(self) -> str:
514-
return self.config.get(self.dir_to_var("waveform"))
515-
516512
@property
517513
def video_dir(self) -> str:
518514
return self.config.get(self.dir_to_var("video"))
@@ -559,7 +555,7 @@ def dlc_output_dir(self) -> str:
559555
temp_dir = None
560556
analysis_dir = None
561557
sorting_dir = None
562-
waveform_dir = None
558+
waveforms_dir = None
563559
video_dir = None
564560
dlc_project_dir = None
565561
dlc_video_dir = None
@@ -572,7 +568,7 @@ def dlc_output_dir(self) -> str:
572568
temp_dir = sg_config.temp_dir
573569
analysis_dir = sg_config.analysis_dir
574570
sorting_dir = sg_config.sorting_dir
575-
waveform_dir = sg_config.waveform_dir
571+
waveforms_dir = sg_config.waveforms_dir
576572
video_dir = sg_config.video_dir
577573
debug_mode = sg_config.debug_mode
578574
test_mode = sg_config.test_mode

src/spyglass/spikesorting/v0/spikesorting_curation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from spyglass.common.common_interval import IntervalList
1717
from spyglass.common.common_nwbfile import AnalysisNwbfile
18-
from spyglass.settings import waveform_dir
18+
from spyglass.settings import waveforms_dir
1919
from spyglass.spikesorting.v0.merged_sorting_extractor import (
2020
MergedSortingExtractor,
2121
)
@@ -331,7 +331,7 @@ def make(self, key):
331331

332332
waveform_extractor_name = self._get_waveform_extractor_name(key)
333333
key["waveform_extractor_path"] = str(
334-
Path(waveform_dir) / Path(waveform_extractor_name)
334+
Path(waveforms_dir) / Path(waveform_extractor_name)
335335
)
336336
if os.path.exists(key["waveform_extractor_path"]):
337337
shutil.rmtree(key["waveform_extractor_path"])
@@ -513,7 +513,7 @@ def make(self, key):
513513
qm[metric_name] = metric
514514
qm_name = self._get_quality_metrics_name(key)
515515
key["quality_metrics_path"] = str(
516-
Path(waveform_dir) / Path(qm_name + ".json")
516+
Path(waveforms_dir) / Path(qm_name + ".json")
517517
)
518518
# save metrics dict as json
519519
logger.info(f"Computed all metrics: {qm}")

0 commit comments

Comments
 (0)