Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove call to code that will not work #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions external_webpage/request_handler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
logger = logging.getLogger("JSON_bourne")


def get_instrument_and_callback(path):

Check failure on line 10 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN201)

external_webpage/request_handler_utils.py:10:5: ANN201 Missing return type annotation for public function `get_instrument_and_callback`

Check failure on line 10 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN001)

external_webpage/request_handler_utils.py:10:33: ANN001 Missing type annotation for function argument `path`
"""
Looks at the path used to connect and picks out the callback function and the instrument name.
Args:
Expand All @@ -33,11 +33,11 @@
return instruments[0].upper(), callback[0]


def get_summary_details_of_all_instruments(data):

Check failure on line 36 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN201)

external_webpage/request_handler_utils.py:36:5: ANN201 Missing return type annotation for public function `get_summary_details_of_all_instruments`

Check failure on line 36 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN001)

external_webpage/request_handler_utils.py:36:44: ANN001 Missing type annotation for function argument `data`
"""
Gets whether ibex is running for each instrument.
:param data: The data scraped from the archiver webpage
:return: A json dictionary containing the states of each instrument (True if running, False otherwise)

Check failure on line 40 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (E501)

external_webpage/request_handler_utils.py:40:101: E501 Line too long (106 > 100)
"""

inst_data = OrderedDict()
Expand All @@ -55,7 +55,7 @@
return inst_data


def get_instrument_time_since_epoch(instrument_name, instrument_data):

Check failure on line 58 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN201)

external_webpage/request_handler_utils.py:58:5: ANN201 Missing return type annotation for public function `get_instrument_time_since_epoch`

Check failure on line 58 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN001)

external_webpage/request_handler_utils.py:58:37: ANN001 Missing type annotation for function argument `instrument_name`

Check failure on line 58 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN001)

external_webpage/request_handler_utils.py:58:54: ANN001 Missing type annotation for function argument `instrument_data`
"""
Return the instrument time as seconds since epoch.

Expand Down Expand Up @@ -84,7 +84,7 @@
inst_time_struct = time.strptime(inst_time_str, time_format)
except ValueError:
logger.exception(
f"{instrument_name}: Value {inst_time_str} from PV {channel} does not match time format "

Check failure on line 87 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (E501)

external_webpage/request_handler_utils.py:87:101: E501 Line too long (101 > 100)
f"{time_format}."
)
raise
Expand All @@ -98,7 +98,7 @@
return inst_time


def set_time_shift(

Check failure on line 101 in external_webpage/request_handler_utils.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN201)

external_webpage/request_handler_utils.py:101:5: ANN201 Missing return type annotation for public function `set_time_shift`
instrument_name,
instrument_data,
time_shift_threshold,
Expand Down Expand Up @@ -145,6 +145,5 @@
raise ValueError(str(instrument) + " not known")
if data[instrument] == "":
raise ValueError("Instrument has become unavailable")
set_time_shift(instrument, data[instrument], time_shift_threshold)


return data[instrument]
Loading