Skip to content

Misc/code cleanup #369

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

Draft
wants to merge 4 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions folding/registries/miner_registry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from itertools import chain
from typing import List, Callable
from typing import List, Callable, Dict, Union

import folding.utils.constants as c
from folding.utils.ops import write_pkl, load_pkl
Expand All @@ -13,7 +13,7 @@ class MinerRegistry:

def __init__(self, miner_uids: List[int]):
self.tasks: List[str] = list(EVALUATION_REGISTRY.keys())
self.registry = dict.fromkeys(miner_uids)
self.registry: Dict[int, Dict[str: Union[int, float, List]]] = dict.fromkeys(miner_uids)

for miner_uid in miner_uids:
self.registry[miner_uid] = {}
Expand Down
4 changes: 1 addition & 3 deletions folding/utils/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,13 @@ def save_files(files: Dict, output_directory: str, write_mode: str = "wb") -> Di
logger.info(f"⏰ Saving files to {output_directory}...")
check_if_directory_exists(output_directory=output_directory)

# loop over all of the output files and save to local disk
filetypes = {}
for filename, content in files.items():
filetypes[filename.split(".")[-1]] = filename

logger.info(f"Saving file {filename} to {output_directory}")
if "em.cpt" in filename:
filename = "em_binary.cpt"

# loop over all of the output files and save to local disk
with open(os.path.join(output_directory, filename), write_mode) as f:
f.write(content)

Expand Down
1 change: 1 addition & 0 deletions folding/validators/reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def get_energies(
protein (Protein): instance of the Protein class
responses (List[JobSubmissionSynapse]): list of JobSubmissionSynapse objects
uids (List[int]): list of uids
job_type (str): type of job ("SyntheticMD", "OrganicMD", "SyntheticML", "OrganicML")

Returns:
Tuple: Tuple containing the energies and the event dictionary
Expand Down