Skip to content

Commit

Permalink
add pre-commit to verify license headers in python files (#68)
Browse files Browse the repository at this point in the history
* commit license header

* add pre-commit to verify license headers in python files

* add empty line after license header
  • Loading branch information
arogozhnikov authored Sep 20, 2024
1 parent 128b691 commit 1c9ddb3
Show file tree
Hide file tree
Showing 87 changed files with 374 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,32 @@ repos:
- id: ruff
# Run the formatter.
- id: ruff-format

- repo: https://github.com/johannsdg/pre-commit-license-headers
rev: v0.1.0
hooks:
- id: check-license-headers
args:
- "--template"
- |
Copyright (c) [YEARS] Chai Discovery, Inc.
This source code is licensed under the Chai Discovery Community License
Agreement (LICENSE.md) found in the root directory of this source tree.
# - "--owner=The Pre-Commit License Headers Authors"
include: .*py
exclude: |
(?x)^(
examples/.*|
.pre-commit-config.yaml|
.pre-commit-hooks.yaml|
.github/workflows/.*yml|
.github/dependabot.yml|
.github/pull_request_template.md|
Dockerfile.chailab|
LICENSE.md|
README.md|
requirements.in|
ruff.toml|
chai_lab/data/residue_constants.py|
pyproject.toml
)$
4 changes: 4 additions & 0 deletions chai_lab/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

__version__ = "0.0.1"
6 changes: 5 additions & 1 deletion chai_lab/chai1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# %%
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.


import math
from collections import Counter
from dataclasses import dataclass
Expand Down
3 changes: 3 additions & 0 deletions chai_lab/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.
4 changes: 4 additions & 0 deletions chai_lab/data/collate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

4 changes: 4 additions & 0 deletions chai_lab/data/collate/collate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import dataclasses
import logging
from typing import Any
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/collate/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from dataclasses import dataclass

from chai_lab.data.dataset.structure.all_atom_structure_context import (
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

4 changes: 4 additions & 0 deletions chai_lab/data/dataset/all_atom_feature_context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import logging
from dataclasses import dataclass
from typing import Any, Final
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/constraints/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

4 changes: 4 additions & 0 deletions chai_lab/data/dataset/constraints/constraint_context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from dataclasses import asdict, dataclass
from typing import Any

Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/embeddings/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

4 changes: 4 additions & 0 deletions chai_lab/data/dataset/embeddings/embedding_context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from dataclasses import asdict, dataclass

import torch
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/embeddings/esm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import os
from contextlib import contextmanager

Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/inference_dataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import logging
import string
from dataclasses import dataclass
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/msas/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

4 changes: 4 additions & 0 deletions chai_lab/data/dataset/msas/msa_context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from dataclasses import dataclass

import torch
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/structure/all_atom_residue_tokenizer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import logging
from dataclasses import dataclass
from itertools import chain
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/structure/all_atom_structure_context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import logging
from dataclasses import asdict, dataclass
from functools import cached_property, partial
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/structure/chain.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from dataclasses import dataclass

from chai_lab.data.dataset.structure.all_atom_structure_context import (
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/structure/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from functools import lru_cache

import torch
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/dataset/templates/context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import logging
from dataclasses import asdict, dataclass

Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

4 changes: 4 additions & 0 deletions chai_lab/data/features/feature_factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

"""Helper methods for generating model input features"""

import logging
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/feature_type.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from enum import Enum


Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/feature_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

"""Utility classes and functions for feature representations"""

from chai_lab.utils.typing import typecheck
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/atom_element.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from torch import Tensor

Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/atom_name.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from torch import Tensor

from chai_lab.data.features.feature_type import FeatureType
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

"""Feature Generator ABC and Default implementation"""

from abc import ABC
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from typing import Any, Literal

import torch
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/docking.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import logging
import random
from dataclasses import dataclass
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/esm_generator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from torch import Tensor

from chai_lab.data.features.feature_type import FeatureType
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/identity.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from einops import rearrange
from torch import Tensor
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/is_cropped_chain.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from torch import Tensor

Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/missing_chain_contact.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from torch import Tensor

Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/msa.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from typing import Any

import torch
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/ref_pos.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch

from chai_lab.data.features.feature_type import FeatureType
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/relative_chain.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from einops import rearrange
from torch import Tensor
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/relative_entity.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from einops import rearrange
from torch import Tensor
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/relative_sep.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from einops import rearrange
from torch import Tensor
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/relative_token.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from einops import rearrange
from torch import Tensor
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/residue_type.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import numpy as np
import torch
from torch import Tensor
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/structure_metadata.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from einops import repeat
from torch import Tensor
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/templates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

"""
Feature generators for templates. This includes the following:
- Template mask (includes both the psuedo beta mask and backbone frame mask)
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/token_dist_restraint.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import logging
from dataclasses import dataclass

Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/generators/token_pair_distance.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

from typing import Any

import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import logging
from dataclasses import dataclass

Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/features/token_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

import torch
from einops import repeat
from torch import Tensor
Expand Down
4 changes: 4 additions & 0 deletions chai_lab/data/io/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Chai Discovery, Inc.
# This source code is licensed under the Chai Discovery Community License
# Agreement (LICENSE.md) found in the root directory of this source tree.

Loading

0 comments on commit 1c9ddb3

Please sign in to comment.