Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update_versioneer
- Loading branch information
Showing
23 changed files
with
187 additions
and
184 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
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 |
---|---|---|
@@ -1,6 +1,21 @@ | ||
class Day(): | ||
def __init__(self, api_key=""): | ||
self.api_key = api_key | ||
|
||
def __init__(self): | ||
self.date = None | ||
self.timesteps = [] | ||
|
||
def __str__(self): | ||
day_str = '' | ||
|
||
date_part = 'Date: ' + str(self.date) + '\n\n' | ||
day_str += date_part | ||
|
||
day_str += 'Timesteps: \n\n' | ||
try: | ||
for timestep in self.timesteps: | ||
day_str += str(timestep) | ||
day_str += '\n' | ||
|
||
except TypeError: | ||
day_str += 'No timesteps' | ||
|
||
return day_str |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
class Element(): | ||
def __init__(self, id=None, value=None, units=None): | ||
def __init__(self, field_code=None, value=None, units=None): | ||
|
||
self.id = id | ||
self.field_code = field_code | ||
self.value = value | ||
self.units = units | ||
|
||
# For elements which can also have a text value | ||
self.text = None | ||
|
||
def __str__(self): | ||
return str(self.value) + ' ' + str(self.units) |
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
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 |
---|---|---|
@@ -1,23 +1,20 @@ | ||
import datetime | ||
|
||
class Observation(): | ||
def __init__(self, api_key=""): | ||
self.api_key = api_key | ||
|
||
def __init__(self): | ||
self.data_date = None | ||
self.continent = None | ||
self.country = None | ||
self.name = None | ||
self.longitude = None | ||
self.latitude = None | ||
self.id = None | ||
self.location_id = None | ||
self.elevation = None | ||
# Stores a list of observations in days | ||
self.days = [] | ||
|
||
def now(self): | ||
""" | ||
Return the final timestep available. This is the most recent observation. | ||
Return the final timestep available. This is the most recent | ||
observation. | ||
""" | ||
|
||
return self.days[-1].timesteps[-1] |
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
class Site(): | ||
def __init__(self, api_key=""): | ||
self.api_key = api_key | ||
|
||
def __init__(self): | ||
self.name = None | ||
self.id = None | ||
self.location_id = None | ||
self.elevation = None | ||
self.latitude = None | ||
self.longitude = None | ||
self.nationalPark = None | ||
self.region = None | ||
self.unitaryAuthArea = None | ||
|
||
def __str__(self): | ||
site_string = '' | ||
for attr, value in self.__dict__.items(): | ||
to_append = attr + ': ' + str(value) + '\n' | ||
site_string += to_append | ||
|
||
return site_string |
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
Oops, something went wrong.