Skip to content

Commit

Permalink
Merge pull request #40 from Hydrology-IFH:working_tree
Browse files Browse the repository at this point in the history
Working_tree
  • Loading branch information
maxschmi authored May 16, 2023
2 parents 66c2a0b + 35d9f7c commit 45b7b61
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change-log

## Version 0.0.29
-add calculation of droped values in quality check

## Version 0.0.28
- MAJOR Error fix: The quality check for T and ET did not consider the decimal multiplier for the limits. So the table 2 from the Method documentation should have looked like this until now, in bold are the numbers that were wrong in the code:

Expand Down
2 changes: 1 addition & 1 deletion weatherDB/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__author__ = "Max Schmit"
__email__ = "[email protected]"
__copyright__ = "Copyright 2023, Max Schmit"
__version__ = "0.0.28"
__version__ = "0.0.29"

if not ("WEATHERDB_MODULE_INSTALLING" in os.environ \
and os.environ["WEATHERDB_MODULE_INSTALLING"]=="True"):
Expand Down
10 changes: 10 additions & 0 deletions weatherDB/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,16 @@ def quality_check(self, period=(None, None), **kwargs):
""".format(
sql_new_qc=self._get_sql_new_qc(period=period),
stid=self.id, para=self._para)

# calculate the percentage of droped values
sql_qc += f"""
UPDATE meta_{self._para}
SET "qc_droped" = ts."qc_droped"
FROM (
SELECT ROUND(((count("raw")-count("qc"))::numeric/count("raw")), 4)*100 as qc_droped
FROM timeseries."{self.id}_{self._para}"
) ts
WHERE station_id = {self.id};"""

# run commands
if "return_sql" in kwargs and kwargs["return_sql"]:
Expand Down

0 comments on commit 45b7b61

Please sign in to comment.