Skip to content

Commit 7dfa6ae

Browse files
committed
Catch up main commits
2 parents e0b0411 + dd8f649 commit 7dfa6ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3757
-2140
lines changed

.bumpclient.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "0.15.3"
2+
current_version = "0.16.9"
33
commit = true
44
tag = false
55

.bumpversion.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "0.15.3"
2+
current_version = "0.16.9"
33
commit = true
44
tag = true
55

.github/workflows/ci.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
python-version: ["3.9", "3.10", "3.11"]
1818
services:
1919
mariadb:
20-
image: mariadb:11.3.2 # released 2024-05-06
20+
image: mariadb:11.6.2 # released 2024-05-06
2121
# Pulls image from DockerHub
2222
# Docker images: https://hub.docker.com/_/mariadb
2323
# Previous version(s):
@@ -29,6 +29,16 @@ jobs:
2929
- 3306:3306
3030
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
3131

32+
postgres:
33+
image: postgres:latest
34+
env:
35+
POSTGRES_DB: murfey_test_db
36+
POSTGRES_PASSWORD: psql_pwd
37+
POSTGRES_USER: psql_user
38+
ports:
39+
- 5432:5432
40+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
41+
3242
steps:
3343
- uses: actions/checkout@v4
3444
- name: Use Python ${{ matrix.python-version }}
@@ -57,7 +67,7 @@ jobs:
5767
docker run --detach --name rabbitmq -p 127.0.0.1:5672:5672 -p 127.0.0.1:15672:15672 test-rabbitmq
5868
docker container list -a
5969
60-
- name: Get database
70+
- name: Get ispyb database
6171
uses: actions/download-artifact@v4
6272
with:
6373
name: database
@@ -74,7 +84,7 @@ jobs:
7484
mysql-version: "11.3"
7585
auto-start: false
7686

77-
- name: Set up test database
87+
- name: Set up test ipsyb database
7888
run: |
7989
set -eu
8090
cp ".github/workflows/config/my.cnf" .my.cnf
@@ -103,12 +113,18 @@ jobs:
103113
run: wget -t 10 -w 1 http://127.0.0.1:15672 -O -
104114

105115
- name: Run tests
116+
env:
117+
POSTGRES_HOST: localhost
118+
POSTGRES_PORT: 5432
119+
POSTGRES_DB: murfey_test_db
120+
POSTGRES_PASSWORD: psql_pwd
121+
POSTGRES_USER: psql_user
106122
run: |
107123
export ISPYB_CREDENTIALS=".github/workflows/config/ispyb.cfg"
108124
PYTHONDEVMODE=1 pytest -v -ra --cov=murfey --cov-report=xml --cov-branch
109125
110126
- name: Upload to Codecov
111-
uses: codecov/codecov-action@v4
127+
uses: codecov/codecov-action@v5
112128
with:
113129
name: ${{ matrix.python-version }}
114130
files: coverage.xml

.github/workflows/publish-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
name: package-distributions
129129
path: dist/
130130
- name: Sign the dists with Sigstore
131-
uses: sigstore/gh-action-sigstore-python@v2.1.1
131+
uses: sigstore/gh-action-sigstore-python@v3.0.0
132132
with:
133133
inputs: >-
134134
./dist/*.tar.gz

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The packages included under the `[developer]` installation key contain some help
2929
- `pre-commit` - Allows for the installation and running of hooks to help with linting, formatting, and type checking your code.
3030
- `pytest` - Used in conjunction with test functions to evaluate the reliability of your code.
3131

32-
Instructions for setting up the database for Murfey to register files to can be found [here](src/murfey/server/MURFEY_DB.md).
32+
Instructions for setting up the database for Murfey to register files to can be found [here](src/murfey/server/README.md).
3333

3434
Finally, you may want to set up an ISPyB mock database server and a Zocalo
3535
development environment. The instructions for this are out of scope here.

pyproject.toml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requires = [
77

88
[project]
99
name = "murfey"
10-
version = "0.15.3"
10+
version = "0.16.9"
1111
description = "Client-Server architecture hauling Cryo-EM data"
1212
readme = "README.md"
1313
keywords = [
@@ -30,31 +30,35 @@ classifiers = [
3030
"Programming Language :: Python :: 3.12",
3131
]
3232
dependencies = [
33+
"backports.entry_points_selectable",
3334
"defusedxml", # For safely parsing XML files
3435
"pydantic>=2",
3536
"requests",
3637
"rich",
3738
"werkzeug",
39+
"xmltodict",
3840
]
3941
[project.optional-dependencies]
4042
cicd = [
41-
"pytest-cov", # Used by Azure Pipelines for PyTest coverage reports
43+
"pytest-cov", # Used for generating PyTest coverage reports
4244
]
4345
client = [
4446
"textual==0.42.0",
4547
"websocket-client",
46-
"xmltodict",
4748
]
4849
developer = [
4950
"bump-my-version", # Version control
5051
"ipykernel", # Enable interactive coding with VS Code and Jupyter Notebook
5152
"pre-commit", # Formatting, linting, type checking, etc.
5253
"pytest", # Test code functionality
5354
]
55+
instrument-server = [
56+
"fastapi[standard]",
57+
"python-jose[cryptography]",
58+
"uvicorn[standard]",
59+
]
5460
server = [
55-
# "matplotlib", # For visual statistical analysis of images
5661
"aiohttp",
57-
"backports.entry_points_selectable",
5862
"cryptography",
5963
"fastapi[standard]",
6064
"ispyb>=10.2.4", # Responsible for setting requirements for SQLAlchemy and mysql-connector-python;
@@ -97,8 +101,13 @@ murfey = "murfey.client:run"
97101
[project.entry-points."murfey.config.extraction"]
98102
"murfey_machine" = "murfey.util.config:get_extended_machine_config"
99103
[project.entry-points."murfey.workflows"]
100-
"lif_to_stack" = "murfey.workflows.lif_to_stack:zocalo_cluster_request"
101-
"tiff_to_stack" = "murfey.workflows.tiff_to_stack:zocalo_cluster_request"
104+
"clem.align_and_merge" = "murfey.workflows.clem.align_and_merge:submit_cluster_request"
105+
"clem.process_raw_lifs" = "murfey.workflows.clem.process_raw_lifs:zocalo_cluster_request"
106+
"clem.process_raw_tiffs" = "murfey.workflows.clem.process_raw_tiffs:zocalo_cluster_request"
107+
"clem.register_align_and_merge_result" = "murfey.workflows.clem.register_align_and_merge_results:register_align_and_merge_result"
108+
"clem.register_lif_preprocessing_result" = "murfey.workflows.clem.register_preprocessing_results:register_lif_preprocessing_result"
109+
"clem.register_tiff_preprocessing_result" = "murfey.workflows.clem.register_preprocessing_results:register_tiff_preprocessing_result"
110+
"spa.flush_spa_preprocess" = "murfey.workflows.spa.flush_spa_preprocess:flush_spa_preprocess"
102111

103112
[tool.setuptools]
104113
package-dir = {"" = "src"}

src/murfey/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import annotations
22

3-
__version__ = "0.15.3"
4-
__supported_client_version__ = "0.15.3"
3+
__version__ = "0.16.9"
4+
__supported_client_version__ = "0.16.9"

src/murfey/cli/inject_spa_processing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
SPAFeedbackParameters,
2222
SPARelionParameters,
2323
)
24-
from murfey.util.spa_params import default_spa_parameters
24+
from murfey.util.processing_params import default_spa_parameters
2525

2626

2727
def run():

src/murfey/cli/transfer.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
from rich.prompt import Confirm
1111

1212
from murfey.client import read_config
13+
from murfey.util.config import MachineConfig
1314

1415

1516
def run():
1617
config = read_config()
17-
known_server = config["Murfey"].get("server")
18+
known_server = config["Murfey"].get("server", "")
19+
instrument_name = config["Murfey"].get("instrument_name", "")
1820

1921
parser = argparse.ArgumentParser(description="Transfer using a remote rsync daemon")
2022

@@ -35,11 +37,13 @@ def run():
3537
console = Console()
3638
murfey_url = urlparse(args.server, allow_fragments=False)
3739

38-
machine_data = requests.get(f"{murfey_url.geturl()}/machine").json()
39-
if Path(args.source or ".").resolve() in machine_data.data_directories.keys():
40-
console.print(
41-
f"[red]Source directory is the base directory for the {machine_data.data_directories[Path(args.source or '.').resolve()]}, exiting"
42-
)
40+
machine_data = MachineConfig(
41+
requests.get(
42+
f"{murfey_url.geturl()}/instruments/{instrument_name}/machine"
43+
).json()
44+
)
45+
if Path(args.source or ".").resolve() in machine_data.data_directories:
46+
console.print("[red]Source directory is the base directory, exiting")
4347
return
4448

4549
cmd = [

src/murfey/client/__init__.py

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,31 @@ def read_config() -> configparser.ConfigParser:
6565
requests.delete = partial(requests.delete, headers={"Authorization": f"Bearer {token}"})
6666

6767

68+
def write_config(config: configparser.ConfigParser):
69+
mcch = os.environ.get("MURFEY_CLIENT_CONFIG_HOME")
70+
murfey_client_config_home = Path(mcch) if mcch else Path.home()
71+
with open(murfey_client_config_home / ".murfey", "w") as configfile:
72+
config.write(configfile)
73+
74+
75+
def main_loop(
76+
source_watchers: List[murfey.client.watchdir.DirWatcher],
77+
appearance_time: float,
78+
transfer_all: bool,
79+
):
80+
log.info(
81+
f"Murfey {murfey.__version__} on Python {'.'.join(map(str, sys.version_info[0:3]))} entering main loop"
82+
)
83+
if appearance_time > 0:
84+
modification_time: float | None = time.time() - appearance_time * 3600
85+
else:
86+
modification_time = None
87+
while True:
88+
for sw in source_watchers:
89+
sw.scan(modification_time=modification_time, transfer_all=transfer_all)
90+
time.sleep(15)
91+
92+
6893
def _enable_webbrowser_in_cygwin():
6994
"""Helper function to make webbrowser.open() work in CygWin"""
7095
if "cygwin" in platform.system().lower() and shutil.which("cygstart"):
@@ -190,12 +215,6 @@ def run():
190215
default=False,
191216
help="Remove source files immediately after their transfer",
192217
)
193-
parser.add_argument(
194-
"--relax",
195-
action="store_true",
196-
default=False,
197-
help="Relax the condition that the source directory needs to be recognised from the configuration",
198-
)
199218
parser.add_argument(
200219
"--name",
201220
type=str,
@@ -319,34 +338,8 @@ def run():
319338
gain_ref=gain_ref,
320339
redirected_logger=rich_handler,
321340
force_mdoc_metadata=not args.ignore_mdoc_metadata,
322-
strict=not args.relax,
323341
processing_enabled=machine_data.get("processing_enabled", True),
324342
skip_existing_processing=args.skip_existing_processing,
325343
)
326344
app.run()
327345
rich_handler.redirect = False
328-
329-
330-
def main_loop(
331-
source_watchers: List[murfey.client.watchdir.DirWatcher],
332-
appearance_time: float,
333-
transfer_all: bool,
334-
):
335-
log.info(
336-
f"Murfey {murfey.__version__} on Python {'.'.join(map(str, sys.version_info[0:3]))} entering main loop"
337-
)
338-
if appearance_time > 0:
339-
modification_time: float | None = time.time() - appearance_time * 3600
340-
else:
341-
modification_time = None
342-
while True:
343-
for sw in source_watchers:
344-
sw.scan(modification_time=modification_time, transfer_all=transfer_all)
345-
time.sleep(15)
346-
347-
348-
def write_config(config: configparser.ConfigParser):
349-
mcch = os.environ.get("MURFEY_CLIENT_CONFIG_HOME")
350-
murfey_client_config_home = Path(mcch) if mcch else Path.home()
351-
with open(murfey_client_config_home / ".murfey", "w") as configfile:
352-
config.write(configfile)

0 commit comments

Comments
 (0)