Skip to content

Commit

Permalink
Update checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswhitfield committed Apr 29, 2024
1 parent 8e16269 commit 6e29da7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dasmon_app/dasmon_listener/amq_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ def on_message(self, frame):
# elif 'timestamp' in data_dict:
# timestamp = data_dict['timestamp']
for key in data_dict:
if key == "monitors" and type(data_dict[key]) == dict:
if key == "monitors" and isinstance(data_dict[key], dict):
for item in data_dict[key]:
# Protect against old API
if not type(data_dict[key][item]) == dict:
if not isinstance(data_dict[key][item], dict):
key_id = self.retrieve_parameter("monitor_count_%s" % str(item))
store_and_cache(
instrument,
Expand Down
2 changes: 1 addition & 1 deletion src/webmon_app/reporting/dasmon/view_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ def get_signals(instrument_id):
if len(latests) == 0:
latests = PVStringCache.objects.filter(instrument=instrument_id, name=item.pv_name)
latest = latests.latest("update_time")
if type(latest.value) == float:
if isinstance(latest.value, float):
value = "%g" % latest.value
else:
value = "%s" % latest.value
Expand Down
2 changes: 1 addition & 1 deletion src/webmon_app/reporting/reduction/view_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def send_template_request(instrument_id, template_dict, user="unknown"):
"""
use_default = False
if "use_default" in template_dict:
if type(template_dict["use_default"]) == bool:
if isinstance(template_dict["use_default"], bool):
use_default = template_dict["use_default"]
else:
use_default = template_dict["use_default"].lower() == "true"
Expand Down
1 change: 1 addition & 0 deletions tests/test_autoreducer_high_memory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""This is to test that the reduction tasks go to the correct autoreducer node
depending on if it requires high memoery or not"""

import psycopg2
import requests
import time
Expand Down

0 comments on commit 6e29da7

Please sign in to comment.