Skip to content

Commit

Permalink
Merge pull request #802 from MolSSI/qcportal_caching
Browse files Browse the repository at this point in the history
Implement client-side dataset caching
  • Loading branch information
bennybp authored Feb 27, 2024
2 parents 32a29a8 + 83dd3e2 commit 345b92c
Show file tree
Hide file tree
Showing 32 changed files with 1,997 additions and 842 deletions.
10 changes: 4 additions & 6 deletions qcarchivetesting/qcarchivetesting/testing_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def stop_job_runner(self) -> None:
"""
self._stop_job_runner()

def client(self, username=None, password=None) -> PortalClient:
def client(self, username=None, password=None, cache_dir=None) -> PortalClient:
"""
Obtain a client connected to this snowflake
Expand All @@ -258,18 +258,16 @@ def client(self, username=None, password=None) -> PortalClient:
The username to connect as
password
The password to use
cache_dir
Directory to store cache files in
Returns
-------
:
A PortalClient that is connected to this snowflake
"""

client = PortalClient(
self.get_uri(),
username=username,
password=password,
)
client = PortalClient(self.get_uri(), username=username, password=password, cache_dir=cache_dir)
client.encoding = self.encoding
return client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ def test_optimization_client_traj(snowflake: QCATestingSnowflake, opt_file: str,
if fetch_traj:
rec._fetch_trajectory()
assert rec.trajectory_ids_ is not None
assert rec.trajectory_records_ is not None
assert rec._trajectory_records is not None
else:
assert rec.trajectory_ids_ is None
assert rec.trajectory_records_ is None
assert rec._trajectory_records is None

assert rec.trajectory_element(0).id == rec_traj.trajectory[0].id
assert rec.trajectory_element(-1).id == rec_traj.trajectory[-1].id
Expand Down
Loading

0 comments on commit 345b92c

Please sign in to comment.