Skip to content
Merged
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
2 changes: 2 additions & 0 deletions serenityff/charge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

# from serenityff.charge.gnn import ChargeCorrectedNodeWiseAttentiveFP, NodeWiseAttentiveFP, Extractor, Trainer

# from . import _version
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from pathlib import Path

default_dash_tree_path = Path(__file__).parent / "default_dash_tree"
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/dataset_preperation/MolMorganDataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Jakob Teetz and other DASH contributors.

import os
import numpy
import pickle
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

# from .attention_extraction import Extractor
# from .training import Trainer
# from .utils import ChargeCorrectedNodeWiseAttentiveFP, NodeWiseAttentiveFP, MolGraphConvFeaturizer, get_graph_from_mol
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/attention_extraction/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from .explainer import Explainer
from .extractor import Extractor

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from .cleaner import CLEANER_CONTENT
from .worker import get_lsf_worker_content, get_slurm_worker_content
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

CLEANER_CONTENT = """
#! /bin/bash

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

worker_template = """
#! /bin/bash

Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/attention_extraction/explainer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from typing import List, Optional, Tuple

from torch import Tensor
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/attention_extraction/extractor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

import argparse
import os
from math import ceil
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/training/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from .trainer import Trainer

__all__ = [Trainer]
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/training/trainer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

import contextlib
import os
from typing import Callable, List, Optional, OrderedDict, Sequence, Tuple, Union
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from .custom_data import CustomData
from .featurizer import MolGraphConvFeaturizer
from .model import ChargeCorrectedNodeWiseAttentiveFP, NodeWiseAttentiveFP
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/utils/attentive_fp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2023-2025 ETH Zurich, Marc Lehner and other DASH contributors.

from typing import Optional, Any
import math

Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/utils/custom_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from typing import Any, Optional, Union

import numpy as np
Expand Down
6 changes: 4 additions & 2 deletions serenityff/charge/gnn/utils/featurizer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""_
This file is necessary to eliminate the packages dependecy on deepchem.
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Necessary to eliminate the packages dependecy on deepchem.

Most of the functionality is adapted from deepchem.
https://github.com/deepchem/deepchem/tree/master/deepchem/feat
"""
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/utils/model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from typing import Optional

import torch
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/utils/rdkit_helper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from typing import List, Optional, Sequence

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/gnn/utils/split_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from math import ceil
from typing import List, Optional, Sequence, Tuple

Expand Down
5 changes: 3 additions & 2 deletions serenityff/charge/tests/test_fundamental.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Unit and regression dev for the serenityff package.
# Copyright (C) 2022-2025 ETH Zurich, Marc Lehner and other DASH contributors.

"""Unit and regression dev for the serenityff package.

Test most fundamental functionality of package
"""
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tests/test_gnn_extraction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

import os
from shutil import rmtree
from typing import OrderedDict, Sequence
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tests/test_gnn_training.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

import os
from typing import OrderedDict

Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tests/test_gnn_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from typing import List, Sequence

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tests/test_off_plugin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

import os

import pytest
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree/atom_features.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Marc Lehner and other DASH contributors.

from typing import Any, Tuple
import numpy as np
from rdkit import Chem
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree/atom_features_reduced.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Marc Lehner and other DASH contributors.

from serenityff.charge.tree.atom_features import (
AtomFeatures,
get_connection_info_bond_type,
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree/dash_tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2023-2025 ETH Zurich, Marc Lehner and other DASH contributors.

from rdkit import Chem

from serenityff.charge.tree.atom_features import AtomFeatures
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree/dash_tree.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2023-2025 ETH Zurich, Marc Lehner and other DASH contributors.

import gzip
import io
import os
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree/node.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Marc Lehner and other DASH contributors.

from __future__ import annotations

from typing import Dict, List
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree/retrieve_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Functionality to obtain the DASH properties data from ETH research archive."""
import zipfile
from enum import Enum, auto
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree/tree_factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Factory for dash Trees with different properties loaded."""
from serenityff.charge.data import dash_props_tree_path
from serenityff.charge.tree.dash_tree import DASHTree, TreeType
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree/tree_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Marc Lehner and other DASH contributors.

from typing import Tuple, Union

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree_develop/develop_node.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Marc Lehner and other DASH contributors.

from typing import Sequence, Tuple, Union

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/tree_develop/tree_constructor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Marc Lehner and other DASH contributors.

import datetime
import pickle
import random
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2023-2025 ETH Zurich, Marc Lehner and other DASH contributors.

import traceback
from typing import List
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2023-2025 ETH Zurich, Marc Lehner and other DASH contributors.

import pickle
import os
from typing import Sequence
Expand Down
4 changes: 3 additions & 1 deletion serenityff/charge/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Classes and functions used by different submodules.
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Classes and functions used by different submodules."""

from .exceptions import ExtractionError, NotInitializedError
from .io import command_to_shell_file
Expand Down
3 changes: 3 additions & 0 deletions serenityff/charge/utils/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.


class ExtractionError(Exception):
"""
Error thrown if Feature extraction did not work properly.
Expand Down
3 changes: 3 additions & 0 deletions serenityff/charge/utils/io.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.


def command_to_shell_file(command: str, filename: str) -> None:
"""
Writes a string to a .sh file
Expand Down
5 changes: 4 additions & 1 deletion serenityff/charge/utils/rdkit_typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# typing tools for the use of rdkit
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Typing tools for the use of rdkit."""

from rdkit import Chem

Molecule = Chem.rdchem.Mol
Expand Down
2 changes: 2 additions & 0 deletions serenityff/charge/utils/serenityff_charge_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from typing import List
import numpy as np

Expand Down
2 changes: 2 additions & 0 deletions tests/_testfiles/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from pathlib import Path

_this = Path(__file__).parent
Expand Down
2 changes: 2 additions & 0 deletions tests/_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Utilitary functions for running the pytests."""
import json
import os
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Pytest configuration file."""

from collections.abc import Sequence
Expand Down
2 changes: 2 additions & 0 deletions tests/serenityff/charge/gnn/utils/test_rdkit_helper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2025 ETH Zurich, Niels Maeder and other DASH contributors.

import numpy as np
import pytest
import torch as pt
Expand Down
2 changes: 2 additions & 0 deletions tests/serenityff/charge/tree/test_retrieve_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from pathlib import Path
from typing import Any, Union

Expand Down
2 changes: 2 additions & 0 deletions tests/serenityff/charge/tree/test_tree_factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

from collections.abc import Callable, Sequence

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions tests/serenityff/charge/utils/test_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Test `serenityff.charge.utils.exceptions`."""

import pytest
Expand Down
2 changes: 2 additions & 0 deletions tests/serenityff/charge/utils/test_io.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Testing `serenityff.charge.utils.io`."""

from pathlib import Path
Expand Down
2 changes: 2 additions & 0 deletions tests/serenityff/charge/utils/test_rdkit_typing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Test `serenityff.charge.utils.rdkit_typing`."""

import pytest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.

"""Test serenityff.charge.utils.serenityff_charge_handler.py."""
from pathlib import Path

Expand Down
Loading