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
102 changes: 102 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Contributing to the BluePhos Pipeline Project

Thank you for your interest in contributing to the BluePhos pipeline project! As a contributor, you’ll work from your fork of the main repository. This document outlines the steps to set up your development environment, guidelines for coding, and instructions for submitting contributions.

## Repository Information

- **Main Repository**: [BluePhos Main Repo](https://github.com/ssec-jhu/bluephos.git)

## How to Fork the Repository

1. **Go to the Repository on GitHub**:
- Open your web browser and navigate to the main repository you want to fork. For the BluePhos pipeline, the URL is [https://github.com/ssec-jhu/bluephos.git](https://github.com/ssec-jhu/bluephos.git).

2. **Click the Fork Button**:
- In the upper-right corner of the repository page, you’ll see a button labeled **Fork**. Click it.
- GitHub will ask you to select your GitHub account or organization where you want the fork to be created.

3. **Wait for the Fork to Complete**:
- GitHub will create a copy of the repository under your account. This new repository is your fork, and you’ll be directed to the forked repository page (e.g., `https://github.com/your-username/bluephos`).

4. **Clone Your Fork Locally**:
- Once your fork is created, you can clone it to your local machine to start working:
```bash
git clone https://github.com/your-username/bluephos.git
cd bluephos
```

You now have your own copy (fork) of the repository where you can make changes independently from the main repository. When you’re ready to contribute back, you can create a pull request from your fork to the main repository.

## Getting Started

1. **Fork the Repository**: First, create a fork of the main repository in your own GitHub account. This will allow you to freely make changes without affecting the main repository.

2. **Clone Your Fork**: Clone your fork to your local machine:
```bash
git clone https://github.com/your-username/bluephos.git
cd bluephos
```

3. **Add the Main Repository as Upstream**: To keep your fork in sync with the latest updates from the main repo, add it as a second remote named `upstream`:
```bash
git remote add upstream https://github.com/ssec-jhu/bluephos.git
```

4. **Create a Branch**: Create a new branch for each feature or bug fix:
```bash
git checkout -b feature/your-feature-name
```

## Making Changes

- **Coding Standards**: Follow PEP 8 for Python code. Use `tox -e format` to ensure code formatting aligns with the repository’s requirements.
- **Testing**: Ensure your changes pass all tests. Include relevant tests for any new features you add.
- **Documentation**: Update the documentation for any significant code changes. This includes comments, docstrings, and relevant updates to the `README.md`.

## Keeping Your Fork Updated

Regularly pull updates from the main repository to keep your fork in sync:
```bash
git fetch upstream
git merge upstream/main
```

## Submitting a Pull Request

When you’re ready to contribute your changes:

1. **Commit Your Changes**: Write concise and descriptive commit messages.
```bash
git add -u # Use 'git add .' if adding new files
git commit -m "Description of changes"
```

2. **Push to Your Fork**:
```bash
git push origin feature/your-feature-name
```

3. **Open a Pull Request**:
- Go to your forked repository on GitHub.
- Click on **New Pull Request**.
- Ensure the base repository is `ssec-jhu/bluephos` and the base branch is `main`.
- Provide a title and description for your pull request.
- Submit the pull request for review.

## Code Review Process

Once you submit a pull request:
- The maintainers will review your changes and may request modifications.
- Please address any feedback and re-submit for review.

## Issues and Support

If you encounter issues or have questions, feel free to open an issue on GitHub. We’ll do our best to assist.

## License

By contributing, you agree that your contributions will be licensed under the same open-source license as the project.

---

Thank you for your contributions to the BluePhos pipeline! We’re excited to work with you.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

BluePhos: An automated pipeline optimizing the synthesis and analysis of blue phosphorescent materials.


# BluePhos Pipeline Introduction

### Overview
Expand Down Expand Up @@ -140,6 +141,9 @@ query_result = ddb.query('''SELECT * FROM '08ca147e-f618-11ee-b38f-eab1f408aca3-
print(query_result.to_df())
```

# Contributing

We welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to this project.



Expand Down
16 changes: 9 additions & 7 deletions bluephos/bluephos_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
__doc__ = """"BluePhos Discovery Pipeline"""

from pathlib import Path
import pandas as pd

import numpy as np
import pandas as pd
from dplutils import cli
from dplutils.pipeline.ray import RayStreamGraphExecutor
from bluephos.tasks.generateligandtable import GenerateLigandTableTask
from bluephos.tasks.nn import NNTask
from bluephos.tasks.optimizegeometries import OptimizeGeometriesTask
from bluephos.tasks.smiles2sdf import Smiles2SDFTask

from bluephos.tasks.dft import DFTTask
from bluephos.tasks.filter_pipeline import (
FilterDFTInTask,
FilterDFTOutTask,
FilterNNInTask,
FilterNNOutTask,
FilterXTBInTask,
FilterXTBOutTask,
FilterDFTInTask,
FilterDFTOutTask,
)
from bluephos.tasks.generateligandtable import GenerateLigandTableTask
from bluephos.tasks.nn import NNTask
from bluephos.tasks.optimizegeometries import OptimizeGeometriesTask
from bluephos.tasks.smiles2sdf import Smiles2SDFTask


def ligand_pair_generator(halides_file, acids_file):
Expand Down
5 changes: 3 additions & 2 deletions bluephos/modules/dft_calculators.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import logging
import multiprocessing
import os
import subprocess
import multiprocessing
import logging
from textwrap import dedent

from bluephos.modules.dft_extract import extract

# Constants
Expand Down
4 changes: 3 additions & 1 deletion bluephos/modules/dft_extract.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import re
import numpy as np
from glob import iglob

import numpy as np

import bluephos.modules.log_config as log_config

# Setup logging and get a logger instance
Expand Down
10 changes: 6 additions & 4 deletions bluephos/tasks/dft.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import multiprocessing
import os
import tempfile
import multiprocessing

import pandas as pd
import bluephos.modules.log_config as log_config
from bluephos.modules.dft_calculators import OrcaCalculator, ASECalculator, remove_second_row
from dplutils.pipeline import PipelineTask
from dplutils import observer
from dplutils.pipeline import PipelineTask

import bluephos.modules.log_config as log_config
from bluephos.modules.dft_calculators import ASECalculator, OrcaCalculator, remove_second_row

# Setup logging and get a logger instance
logger = log_config.setup_logging(__name__)
Expand Down
3 changes: 2 additions & 1 deletion bluephos/tasks/generateligandtable.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pandas as pd
import bluephos.modules.log_config as log_config
from dplutils.pipeline import PipelineTask
from rdkit.Chem import AllChem, MolFromSmiles, MolToSmiles

import bluephos.modules.log_config as log_config

# Setup logging and get a logger instance
logger = log_config.setup_logging(__name__)

Expand Down
2 changes: 1 addition & 1 deletion bluephos/tasks/nn.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import pandas as pd
import torch as t
import torch.nn.functional as F
import bluephos.modules.log_config as log_config
from dplutils.pipeline import PipelineTask
from torch.nn import Dropout, Linear
from torch.nn.init import kaiming_normal_
from torch_geometric.loader import DataLoader
from torch_geometric.nn import GCN, Set2Set

import bluephos.modules.log_config as log_config
from bluephos.modules.sdf2feature import feature_create

# Setup logging and get a logger instance
Expand Down
8 changes: 5 additions & 3 deletions bluephos/tasks/optimizegeometries.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import bluephos.modules.log_config as log_config
from time import sleep

import pandas as pd
from ase.calculators.calculator import InputError
from dplutils.pipeline import PipelineTask
from dplutils import observer
from dplutils.pipeline import PipelineTask
from rdkit import Chem
from rdkit.Chem import AddHs, MolToXYZBlock
from bluephos.modules.annotate_rdkit_with_ase import optimize_geometry, annotate_molecule_property

import bluephos.modules.log_config as log_config
from bluephos.modules.annotate_rdkit_with_ase import annotate_molecule_property, optimize_geometry
from bluephos.modules.bond_length import bonds_maintained
from bluephos.modules.isoctahedral import isoctahedral
from bluephos.modules.octahedral_embed import octahedral_embed
Expand Down
3 changes: 2 additions & 1 deletion bluephos/tasks/smiles2sdf.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from functools import reduce

import pandas as pd
import bluephos.modules.log_config as log_config
from dplutils.pipeline import PipelineTask
from rdkit import Chem
from rdkit.Chem import AddHs, AllChem, MolFromSmiles
from rdkit.Chem.rdmolops import CombineMols, Kekulize, SanitizeMol

import bluephos.modules.log_config as log_config

# Setup logging and get a logger instance
logger = log_config.setup_logging(__name__)
Expand Down
8 changes: 5 additions & 3 deletions tests/test_dft_task.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os
import pytest
import pandas as pd
from unittest.mock import patch
from bluephos.tasks.dft import dft_run, remove_second_row, OrcaCalculator

import pandas as pd
import pytest

from bluephos.tasks.dft import OrcaCalculator, dft_run, remove_second_row


@pytest.fixture
Expand Down
Loading