-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Read station list from a file (#269)
* Fixed Issue #174 * Incorporating the helper functions * Adding TODO * Adding TODO
- Loading branch information
1 parent
136e8a6
commit ae6a574
Showing
6 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,3 +176,4 @@ tutorials/pnw_data | |
|
||
# Jupyterbook | ||
_build/ | ||
log.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
RPV | ||
SVD | ||
BBR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
new_station1 | ||
new_station2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
|
||
from noisepy.seis.datatypes import ConfigParameters | ||
|
||
|
||
def test_stations_file_behavior(): | ||
# Test loading from stations_file | ||
config = ConfigParameters(stations_file=os.path.join(os.path.dirname(__file__), "./data/stations.txt")) | ||
assert config.stations == ["*"] | ||
|
||
config.load_stations() | ||
|
||
assert config.stations == ["RPV", "SVD", "BBR"] | ||
|
||
new_stations = ["new_station1", "new_station2"] | ||
config.stations_file = os.path.join(os.path.dirname(__file__), "./data/stations1.txt") | ||
ConfigParameters.save_stations(config, new_stations) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters