Skip to content

Commit

Permalink
run linting, fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
kjappelbaum committed Aug 12, 2024
1 parent fd0fa92 commit da28ebc
Show file tree
Hide file tree
Showing 240 changed files with 19,229 additions and 19,955 deletions.
Binary file removed .DS_Store
Binary file not shown.
44 changes: 21 additions & 23 deletions .github/workflows/install.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
---
# GitHub action that attempts to install the conda env
# from conda.yaml
# then run black, isort, flake8

name: Install
on: [push, pull_request]
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
environment-file: conda.yaml
activate-environment: chemnlp
python-version: 3.9
auto-update-conda: true
auto-activate-base: false
- name: Validate yaml
shell: bash -l {0}
run: |
conda activate chemnlp
python -m src.chemnlp.data_val.validate data
- name: Tests
shell: bash -l {0}
run: |
pip install pytest
pytest tests
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
environment-file: conda.yaml
activate-environment: chemnlp
python-version: 3.9
auto-update-conda: true
auto-activate-base: false
- name: Validate yaml
shell: bash -l {0}
run: |
conda activate chemnlp
python -m src.chemnlp.data_val.validate data
- name: Tests
shell: bash -l {0}
run: |
pip install pytest
pytest tests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,5 @@ scratch/
# vim
*~
*.swp

.DS_Store
12 changes: 0 additions & 12 deletions .gitmodules

This file was deleted.

129 changes: 89 additions & 40 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,90 @@
---
ci:
autoupdate_schedule: quarterly
autofix_prs: false
submodules: false

default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: miscellaneous/structures/SiO2.xyz

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt
exclude: ^experiments/configs

- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--count, --show-source, --statistics]
additional_dependencies:
- flake8-bugbear==22.7.1

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black, --filter-files]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-yaml
exclude: "kubernetes.yaml$" # This line excludes kubernetes.yaml from being checked as it is WIP
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
exclude: .gitignore
- id: trailing-whitespace
exclude: .gitignore
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black-jupyter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.2
hooks:
- id: prettier
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamlfmt
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
exclude: poetry.lock
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: [".[toml]"]
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.1.0
hooks:
- id: sqlfluff-fix
- repo: https://github.com/hadolint/hadolint
rev: v2.13.0-beta
hooks:
- id: hadolint-docker
- repo: https://github.com/jsh9/markdown-toc-creator
rev: 0.0.6
hooks:
- id: markdown-toc-creator
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: check-mailmap
- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
hooks:
- id: poetry-check
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
hooks:
- id: mypy
additional_dependencies:
- types-requests
- repo: https://github.com/srstevenson/nb-clean
rev: 3.3.0
hooks:
- id: nb-clean
args: [--preserve-cell-outputs, --remove-empty-cells]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
hooks:
- id: validate-pyproject
additional_dependencies:
- "validate-pyproject-schema-store[all]>=2024.06.24" # Pin for Ruff's FURB154
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ ChemNLP is an open-source project - your involvement is warmly welcome! If you'r
- Looking for ideas? See our [task board](https://github.com/orgs/OpenBioML/projects/5/views/1) to see what we may need help with.
- Have an idea? Create an [issue](https://github.com/OpenBioML/chemnlp/issues)!


Over the past months ChemNLP has received many contributions and a lot of feedback. We appreciate all contributions from community to make ChemNLP thrive.

<a href="https://github.com/openbioml/chemnlp/graphs/contributors">
<img src="https://contrib.rocks/image?repo=openbioml/chemnlp" />
</a>


# Note on the "ChemNLP" name

Our OpenBioML ChemNLP project is not affiliated to the [ChemNLP library from NIST](https://arxiv.org/abs/2209.08203) and we use "ChemNLP" as a general term to highlight our project focus. The datasets and models we create through our project will have a unique and recognizable name when we release them.
Expand Down
21 changes: 10 additions & 11 deletions code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributor Covenant Code of Conduct

## Our Pledge
Expand All @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down
13 changes: 6 additions & 7 deletions conda.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
name: dummy
dependencies:
- python==3.9.*
- pip
- pip:
- .
- .[dev]
- .[dataset_creation]
- python==3.9.*
- pip
- pip:
- .
- .[dev]
- .[dataset_creation]
73 changes: 34 additions & 39 deletions data/kg/chebi_chebi/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
---
name: chebi_chebi
description: Knowledgegraph data samples.
targets:
- id: node2_type
description: node2_type
type: Other
units: node2_type
names:
- noun: node2_type
- id: node2_name
description: node2_name
type: Other
units: node2_name
names:
- noun: node2_name
- id: node2_id
description: node2_id
type: Other
units: node2_id
names:
- noun: node2_id
- id: node2_type
description: node2_type
type: Other
units: node2_type
names:
- noun: node2_type
- id: node2_name
description: node2_name
type: Other
units: node2_name
names:
- noun: node2_name
- id: node2_id
description: node2_id
type: Other
units: node2_id
names:
- noun: node2_id
identifiers:
- id: node1_type
description: node1_type
type: Other
- id: node1_name
description: node1_name
type: Other
- id: node1_id
description: node1_id
type: Other
- id: rel1_type
description: rel1_type
type: Other
- id: node1_type
description: node1_type
type: Other
- id: node1_name
description: node1_name
type: Other
- id: node1_id
description: node1_id
type: Other
- id: rel1_type
description: rel1_type
type: Other
license: CC BY 4.0
links:
- url: https://crossbar.kansil.org
description: original knowledge graph web GUI link
- url: https://crossbar.kansil.org
description: original knowledge graph web GUI link
num_points: 638182
bibtex:
- "@article{10.1093/nar/gkab543,\nauthor = {Doğan, Tunca and Atas, Heval and Joshi, Vishal and Atakan, Ahmet and Rifaioglu, Ahmet Sureyya and Nalbat,\
\ Esra and Nightingale, Andrew and Saidi, Rabie and Volynkin, Vladimir and Zellner, Hermann and Cetin-Atalay, Rengul and Martin, Maria and Atalay,\
\ Volkan},\ntitle = \"{CROssBAR: comprehensive resource of biomedical relations with knowledge graph representations}\",\njournal = {Nucleic Acids\
\ Research},\nvolume = {49},\nnumber = {16},\npages = {e96-e96},\nyear = {2021},\nmonth = {06},\nissn = {0305-1048},\ndoi = {10.1093/nar/gkab543},\n\
url = {https://doi.org/10.1093/nar/gkab543},\n}"
- "@article{10.1093/nar/gkab543,\nauthor = {Doğan, Tunca and Atas, Heval and Joshi, Vishal and Atakan, Ahmet and Rifaioglu, Ahmet Sureyya and Nalbat, Esra and Nightingale, Andrew and Saidi, Rabie and Volynkin, Vladimir and Zellner, Hermann and Cetin-Atalay, Rengul and Martin, Maria and Atalay, Volkan},\ntitle = \"{CROssBAR: comprehensive resource of biomedical relations with knowledge graph representations}\",\njournal = {Nucleic Acids Research},\nvolume = {49},\nnumber = {16},\npages = {e96-e96},\nyear = {2021},\nmonth = {06},\nissn = {0305-1048},\ndoi = {10.1093/nar/gkab543},\nurl = {https://doi.org/10.1093/nar/gkab543},\n}"
templates:
- The {node1_name#} {rel1_type#} {node2_name#}.
- The {node1_name#} {rel1_type#} {node2_name#}.
Loading

0 comments on commit da28ebc

Please sign in to comment.