Skip to content

Commit

Permalink
Merge pull request #65 from kaklise/master
Browse files Browse the repository at this point in the history
Updates to the mask, no longer assigns Null values to False
  • Loading branch information
kaklise authored Jul 29, 2020
2 parents 66f9120 + 1e32a7b commit dde783f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions documentation/whatsnew.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Release Notes
================

.. include:: whatsnew/v0.1.8.1.rst

.. include:: whatsnew/v0.1.8.rst

.. include:: whatsnew/v0.1.7.rst
Expand Down
9 changes: 9 additions & 0 deletions documentation/whatsnew/v0.1.8.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _whatsnew_0181:

v0.1.8.1 (master)
--------------------------

* Bug fix in the way masks are generated. Data points that have Null values were always assigned to False, indicating
that a quality control test failed. Null values are now assumed to be True, unless a specific test fails (e.g. check_missing).


2 changes: 1 addition & 1 deletion pecos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pecos import utils
from pecos import pv

__version__ = '0.1.8'
__version__ = '0.1.8.1'

__copyright__ = """Copyright 2016-2020 National Technology & Engineering
Solutions of Sandia, LLC (NTESS). Under the terms of Contract
Expand Down
6 changes: 4 additions & 2 deletions pecos/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def mask(self):
logger.info("Empty database")
return

mask = ~pd.isnull(self.df) # False if NaN
mask = pd.DataFrame(True, index=self.df.index, columns=self.df.columns)
for i in self.test_results.index:
variable = self.test_results.loc[i, 'Variable Name']
start_date = self.test_results.loc[i, 'Start Time']
Expand All @@ -78,7 +78,9 @@ def mask(self):
mask.loc[start_date:end_date,variable] = False
except:
pass

elif self.test_results.loc[i, 'Error Flag'] == 'Missing timestamp':
mask.loc[start_date:end_date,:] = False

return mask

@property
Expand Down

0 comments on commit dde783f

Please sign in to comment.