Skip to content

Commit

Permalink
Check invalid stations parameter type for Client.select_stations() (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored May 20, 2021
1 parent 8c3c96d commit 0a81031
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions HinetPy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,9 +1151,16 @@ def select_stations(
0
"""
stations_selected = []

if stations is None:
stations = []
stations_selected = stations
pass
elif isinstance(stations, str): # stations is a str, i.e., one station
stations_selected.append(stations)
elif isinstance(stations, list):
stations_selected.extend(stations)
else:
raise ValueError("stations should be either a str or a list.")

# get station list from Hi-net server
stations_at_server = self.get_station_list(code)
Expand Down

0 comments on commit 0a81031

Please sign in to comment.