Skip to content

Commit a8ec52e

Browse files
committed
Removed 'get_machine_config' that was reintroduced from old version during merge
1 parent 3dc461b commit a8ec52e

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/murfey/util/__init__.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@
1313
from queue import Queue
1414
from threading import Thread
1515
from typing import Awaitable, Callable, Dict, List, Optional, Tuple, Union
16-
from urllib.parse import ParseResult, urlparse, urlunparse
16+
from urllib.parse import urlparse, urlunparse
1717
from uuid import uuid4
1818

1919
import requests
2020
from werkzeug.utils import secure_filename
2121

22-
from murfey.util.models import Visit
23-
2422
logger = logging.getLogger("murfey.util")
2523

2624

@@ -98,24 +96,6 @@ def posix_path(path: Path) -> str:
9896
return str(path)
9997

10098

101-
@lru_cache(maxsize=1)
102-
def get_machine_config(url: str, instrument_name: str = "", demo: bool = False) -> dict:
103-
_instrument_name: str | None = instrument_name or os.getenv("BEAMLINE")
104-
if not _instrument_name:
105-
return {}
106-
return requests.get(f"{url}/instruments/{_instrument_name}/machine").json()
107-
108-
109-
def _get_visit_list(api_base: ParseResult, instrument_name: str):
110-
get_visits_url = api_base._replace(
111-
path=f"/instruments/{instrument_name}/visits_raw"
112-
)
113-
server_reply = requests.get(get_visits_url.geturl())
114-
if server_reply.status_code != 200:
115-
raise ValueError(f"Server unreachable ({server_reply.status_code})")
116-
return [Visit.parse_obj(v) for v in server_reply.json()]
117-
118-
11999
def capture_post(url: str, json: dict | list = {}) -> requests.Response | None:
120100
try:
121101
response = requests.post(url, json=json)

0 commit comments

Comments
 (0)