Skip to content

Commit c58fcc8

Browse files
Merge branch 'main' into bc/async-block
2 parents a22a7c3 + 22f70a4 commit c58fcc8

File tree

7 files changed

+97
-155
lines changed

7 files changed

+97
-155
lines changed

pydatalab/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ dev-dependencies = [
124124
"pytest-dependency ~= 0.6",
125125
"pytest-memray ~= 1.8",
126126
"pre-commit ~= 4.0",
127-
"mongomock ~= 4.1",
128127
"mkdocs ~= 1.6",
129128
"mkdocs-material ~= 9.5",
130129
"mkdocstrings[python] ~= 0.29",

pydatalab/scripts/add_test_cell_to_db.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

pydatalab/scripts/migrate_set_all_constituents_as_parents_TypedRelationship.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

pydatalab/src/pydatalab/mongo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import atexit
22
from functools import lru_cache
33

4-
# Must be imported in this way to allow for easy patching with mongomock
54
import pymongo
65
from flask_pymongo import PyMongo
76
from pydantic import BaseModel

pydatalab/tests/server/conftest.py

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
from pathlib import Path
2-
from unittest.mock import patch
32

4-
import mongomock
53
import pymongo
64
import pytest
75
from bson import ObjectId
86
from flask.testing import FlaskClient
97

10-
import pydatalab.mongo
118
from pydatalab.models import Cell, Collection, Equipment, Sample, StartingMaterial
129
from pydatalab.models.people import AccountStatus
1310

1411
TEST_DATABASE_NAME = "__datalab-testing__"
1512

1613

17-
class PyMongoMock(mongomock.MongoClient):
18-
def init_app(self, _, *args, **kwargs):
19-
return super().__init__(MONGO_URI)
20-
21-
2214
MONGO_URI = f"mongodb://localhost:27017/{TEST_DATABASE_NAME}"
2315

2416

@@ -83,42 +75,20 @@ def app_config(tmp_path_factory, secret_key):
8375

8476

8577
@pytest.fixture(scope="module")
86-
def app(real_mongo_client, monkeypatch_session, app_config):
87-
"""Yields the test app.
88-
89-
If it exists, connects to a local MongoDB, otherwise uses the
90-
mongomock testing backend.
91-
92-
"""
78+
def app(real_mongo_client, app_config):
79+
"""Yields the test app."""
9380
from pydatalab.main import create_app
9481

95-
try:
96-
mongo_cli = real_mongo_client
97-
if mongo_cli is None:
98-
raise pymongo.errors.ServerSelectionTimeoutError
99-
100-
databases = mongo_cli.list_database_names()
82+
mongo_cli = real_mongo_client
83+
if mongo_cli is None:
84+
raise pymongo.errors.ServerSelectionTimeoutError(
85+
"Tests require a running local MongoDB instance."
86+
)
10187

102-
if TEST_DATABASE_NAME in databases:
103-
mongo_cli.drop_database(TEST_DATABASE_NAME)
88+
databases = mongo_cli.list_database_names()
10489

105-
except pymongo.errors.ServerSelectionTimeoutError:
106-
with patch.object(
107-
pydatalab.mongo,
108-
"flask_mongo",
109-
PyMongoMock(MONGO_URI, connectTimeoutMS=100, serverSelectionTimeoutMS=100),
110-
):
111-
112-
def mock_mongo_client():
113-
return PyMongoMock(MONGO_URI, connectTimeoutMS=100, serverSelectionTimeoutMS=100)
114-
115-
def mock_mongo_database():
116-
return mock_mongo_client().get_database(TEST_DATABASE_NAME)
117-
118-
monkeypatch_session.setattr(
119-
pydatalab.mongo, "_get_active_mongo_client", mock_mongo_client
120-
)
121-
monkeypatch_session.setattr(pydatalab.mongo, "get_database", mock_mongo_database)
90+
if TEST_DATABASE_NAME in databases:
91+
mongo_cli.drop_database(TEST_DATABASE_NAME)
12292

12393
app = create_app(app_config, env_file=False)
12494

pydatalab/uv.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webapp/src/views/About.vue

Lines changed: 87 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,98 @@
4343
</table>
4444
</div>
4545

46-
datalab was primarily developed by:
46+
<h5>Credits and acknowledgements</h5>
47+
48+
<p><i>datalab</i> was initially conceived and developed by:</p>
4749
<ul>
4850
<li>
49-
<a href="https://github.com/jdbocarsly"
50-
><font-awesome-icon :icon="['fab', 'github']" /></a
51-
>&nbsp;Joshua Bocarsly (Department of Chemistry, University of Houston, previously
52-
Department of Chemistry, University of Cambridge)
51+
<a href="https://jdbocarsly.github.io">Prof Joshua Bocarsly</a> (<a
52+
href="https://www.uh.edu/nsm/chemistry"
53+
>Department of Chemistry, University of Houston</a
54+
>, previously
55+
<a href="https://www.ch.cam.ac.uk/">Department of Chemistry, University of Cambridge</a
56+
>)
5357
</li>
5458
<li>
55-
<a href="https://github.com/ml-evs"><font-awesome-icon :icon="['fab', 'github']" /></a
56-
>&nbsp;Matthew Evans (MODL-IMCN, UCLouvain & Matgenix)
59+
<a href="https://ml-evs.science">Dr Matthew Evans</a> (<a
60+
href="https://www.ch.cam.ac.uk/"
61+
>Department of Chemistry, University of Cambridge</a
62+
>, previously
63+
<a href="https://uclouvain.be/en/research-institutes/imcn/modl">MODL-IMCN, UCLouvain</a>
64+
&amp; <a href="https://matgenix.com">Matgenix</a>)
5765
</li>
5866
</ul>
67+
<p>
68+
with support from the group of
69+
<a href="https://grey.group.ch.cam.ac.uk/group">Professor Clare Grey</a> (University of
70+
Cambridge), and major contributions from:
71+
</p>
72+
<ul>
73+
<li><a href="https://github.com/BenjaminCharmes">Benjamin Charmes</a></li>
74+
<li><a href="https://github.com/be-smith/">Dr Ben Smith</a></li>
75+
<li><a href="https://github.com/yue-here">Dr Yue Wu</a></li>
76+
</ul>
77+
<p>
78+
plus contributions, feedback and testing performed by other members of the community, in
79+
particular, the groups of
80+
<a href="https://cliffegroup.co.uk">Prof Matt Cliffe</a> (University of Nottingham) and
81+
<a href="https://www.tu.berlin/en/concat">Dr Peter Kraus</a> (TUBerlin) and the company
82+
<a href="https://matgenix.com">Matgenix SRL</a>.
83+
</p>
84+
<p>
85+
A full list of code contributions can be found on
86+
<a href="https://github.com/datalab-org/datalab/graphs/contributors">GitHub</a>.
87+
</p>
5988

60-
This project has received funding from the European Union's Horizon 2020 research and
61-
innovation programme under grant agreement 957189 (DOI:
62-
<a href="https://doi.org/10.3030/957189">10.3030/957189</a>), the
63-
<a href="https://www.big-map.eu"
64-
>Battery Interface Genome - Materials Acceleration Platform (BIG-MAP)</a
65-
>
66-
, as an external stakeholder project.
89+
<p>
90+
Contributions to <i>datalab</i> have been supported by a mixture of academic funding and
91+
consultancy work through
92+
<a href="https://datalab.industries"><em>datalab industries ltd</em></a
93+
>.
94+
</p>
95+
<p>In particular, the developers thank:</p>
96+
<ul>
97+
<li>
98+
Initial proof-of-concept funding from the European Union's Horizon 2020 research and
99+
innovation programme under grant agreement 957189 (DOI:
100+
<a href="https://doi.org/10.3030/957189">10.3030/957189</a>), the
101+
<a href="https://www.big-map.eu"
102+
>Battery Interface Genome - Materials Acceleration Platform (BIG-MAP)</a
103+
>, as an external stakeholder project.
104+
</li>
105+
<li>
106+
The <a href="https://www.faraday.ac.uk">Faraday Institution</a> CATMAT project (FIRG016)
107+
for support of Dr Joshua Bocarsly during initial development of <em>datalab</em>.
108+
</li>
109+
<li>
110+
The <a href="https://leverhulme.ac.uk">Leverhulme Trust</a> and
111+
<a href="https://newtontrust.cam.ac.uk">Isaac Newton Trust</a> for support provided by
112+
an early career fellowship for Dr Matthew Evans.
113+
</li>
114+
</ul>
67115

68116
<div align="center" style="padding-top: 20px">
69-
<img src="https://avatars.githubusercontent.com/u/75324577" width="100" target="_blank" />
117+
<a href="https://wwww.big-map.eu"
118+
><img
119+
class="funding-logo"
120+
src="https://avatars.githubusercontent.com/u/75324577"
121+
width="100"
122+
target="_blank"
123+
/></a>
124+
<a href="https://wwww.leverhulme.ac.uk"
125+
><img
126+
class="funding-logo"
127+
src="https://www.leverhulme.ac.uk/sites/default/files/Leverhulme_Trust_RGB_blue_0_0.png"
128+
width="250"
129+
target="_blank"
130+
/></a>
131+
<a href="https://www.faraday.ac.uk"
132+
><img
133+
class="funding-logo"
134+
src="https://www.faraday.ac.uk/wp-content/themes/faraday/assets/faraday-logo-highres.png"
135+
width="250"
136+
target="_blank"
137+
/></a>
70138
</div>
71139

72140
<!-- <tiny-mce-inline /> -->
@@ -111,4 +179,8 @@ th {
111179
border-left: 1px solid #ddd;
112180
border-bottom: 1px solid #ddd;
113181
}
182+
183+
.funding-logo {
184+
margin: 10px;
185+
}
114186
</style>

0 commit comments

Comments
 (0)