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

Implement client-side dataset caching #802

Merged
merged 22 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
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
Loading