Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
correct exceptions
unused import
syntactic sugar dict
  • Loading branch information
sbrugman committed Oct 12, 2021
1 parent bacf8dd commit ba7bac1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion popmon/base/module.py
Expand Up @@ -56,7 +56,7 @@ def get_datastore_object(self, datastore, feature, dtype, default=None):
else:
raise ValueError(f"`{feature}` not found in the datastore!")
if not isinstance(obj, dtype):
raise ValueError(f"obj `{feature}` is not an instance of `{dtype}`!")
raise TypeError(f"obj `{feature}` is not an instance of `{dtype}`!")
return obj

def get_features(self, all_features):
Expand Down
6 changes: 2 additions & 4 deletions popmon/pipeline/report.py
Expand Up @@ -126,13 +126,11 @@ def stability_report(
# perform basic input checks
reference_types = list(_report_pipeline.keys())
if reference_type not in reference_types:
raise TypeError(f"reference_type should be one of {str(reference_types)}.")

raise ValueError(f"reference_type should be one of {str(reference_types)}.")
if not isinstance(hists, dict):
raise TypeError("hists should be a dict of histogrammar histograms.")
if reference_type == "external" and not isinstance(reference, dict):
raise TypeError("reference should be a dict of histogrammar histograms.")

if not isinstance(monitoring_rules, dict):
monitoring_rules = {
"*_pull": [7, 4, -4, -7],
Expand Down Expand Up @@ -167,8 +165,8 @@ def stability_report(
"plot_hist_n": plot_hist_n,
"report_filepath": report_filepath,
"show_stats": show_stats,
**kwargs
}
cfg.update(kwargs)

datastore = {"hists": hists}
if reference_type == "external":
Expand Down
1 change: 0 additions & 1 deletion popmon/visualization/section_generator.py
Expand Up @@ -18,7 +18,6 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


import fnmatch
import multiprocessing

import numpy as np
Expand Down

0 comments on commit ba7bac1

Please sign in to comment.