Commit 64d593ee authored by miaecle's avatar miaecle
Browse files

fix conflict

parents f373058b 6f86377d
Loading
Loading
Loading
Loading
+44 −11
Original line number Diff line number Diff line
# DeepChem


## DeepChem Technical Steering Committee
The Technical Steering Committee admits and oversees all top-level of DeepChem.

The TSC exercises autonomy in setting up and maintaining procedures, policies, and management and administrative structures as it deems appropriate for the maintenance and operation of these projects and resources.
Included in the responsibilities of the TSC are:

* Managing code and documentation creation and changes for the listed projects and resources
* Performing code reviews on incoming pull requests and merging suitable code changes.
* Setting and maintaining standards covering contributions of code, documentation and other materials
* Managing code and binary releases: types, schedules, frequency, delivery mechanisms
* Making decisions regarding dependencies of DeepChem, including what those dependencies are and how they are bundled with source code and releases
* Creating new repositories and projects under the deepchem GitHub organization as required
* Setting overall technical direction for the DeepChem project, including high-level goals and low-level specifics regarding features and functionality
* Setting and maintaining appropriate standards for community discourse via the various mediums under TSC control (gitter, facebook, blog)

Members of the TSC will meet regularly (over phone or video conferencing) to coordinate efforts. Minutes from the TSC meetings will be published publicly on an ongoing basis.
 The current members of the TSC are (alphabetically)
* Peter Eastman
* Karl Leswing
* Bharath Ramsundar
* Zhenqin Wu

If you want to join the technical steering committee, you will need to submit an application. The application process is relatively lightweight: submit a one page document discussing your past contributions to DeepChem and propose potential projects you could commit to working on as a member of the steering committee. Note that steering committee membership comes with responsibilities. In particular, you will need to commit to spending about 10 hours a week working on DeepChem. The committee will review your application, and if suitable, will accept you as a probationary member of the TSC. Your application will be posted publicly to the DeepChem blog if accepted. Membership on the committee will be confirmed after 6 months if you’ve successfully implemented some of your proposed projects and demonstrated your ability to meet the necessary time commitment.

## Contributing to DeepChem

We actively encourage community contributions to DeepChem. The first place to start getting involved is by running our examples locally. Afterwards, we encourage contributors to give a shot to improving our documentation. While we take effort to provide good docs, there's plenty of room for improvement. All docs are hosted on Github, either in `README.md` file, or in the `docs/` directory.

Once you've got a sense of how the package works, we encourage the use of Github issues to discuss more complex changes,  raise requests for new features or propose changes to the global architecture of DeepChem. Once consensus is reached on the issue, please submit a PR with proposed modifications. All contributed code to DeepChem will be reviewed by a member of the DeepChem team, so please make sure your code style and documentation style match our guidelines!

## Contributor License Agreement
In order to get a pull request accepted you must fill out our [License Agreement](https://www.clahub.com/agreements/deepchem/deepchem).  The purpose of this agreement is to enable DeepChem to distribute your code and its derivatives.

### The Agreement
Contributor offers to license certain software (a “Contribution” or multiple “Contributions”) to DeepChem, and DeepChem agrees to accept said Contributions, under the terms of the open source license [The MIT License](https://opensource.org/licenses/MIT)


The Contributor understands and agrees that DeepChem shall have the irrevocable and perpetual right to make and distribute copies of any Contribution, as well as to create and distribute collective works and derivative works of any Contribution, under [The MIT License](https://opensource.org/licenses/MIT).
## Pull Request Process
Every contribution, must be a pull request and must have adequate time for review by other committers.

A member of the Technical Steering Committee will review the pull request.  The default path of every contribution should be to merge. The discussion, review, and merge process should be designed as corrections that move the contribution into the path to merge. Once there are no more corrections, (dissent) changes should merge without further process.

DeepChem understands and agrees that Contributor retains copyright in its Contributions. Nothing in this Contributor Agreement shall be interpreted to prohibit Contributor from licensing its Contributions under different terms from the [The MIT License](https://opensource.org/licenses/MIT) or this Contributor Agreement.
On successful merge the author will be added as a member of the DeepChem organization.

### Code Style Guidelines
## Code Style Guidelines
DeepChem uses [yapf](https://github.com/google/yapf) to autoformat code.

``` bash
pip install yapf==0.17.0
pip install yapf==0.20.0
cd <git_root>
yapf -i <python_files changed>
```

Our integration tests will fail if code is not formatted correctly

### Documentation Style Guidelines
## Documentation Style Guidelines
DeepChem uses [NumPy style documentation](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt). Please follow these conventions when documenting code, since we use [Sphinx+Napoleon](http://www.sphinx-doc.org/en/stable/ext/napoleon.html) to automatically generate docs on [deepchem.io](deepchem.io).


## Contributor License Agreement
In order to get a pull request accepted you must fill out our [License Agreement](https://www.clahub.com/agreements/deepchem/deepchem).  The purpose of this agreement is to enable DeepChem to distribute your code and its derivatives.

## The Agreement
Contributor offers to license certain software (a “Contribution” or multiple “Contributions”) to DeepChem, and DeepChem agrees to accept said Contributions, under the terms of the open source license [The MIT License](https://opensource.org/licenses/MIT)


The Contributor understands and agrees that DeepChem shall have the irrevocable and perpetual right to make and distribute copies of any Contribution, as well as to create and distribute collective works and derivative works of any Contribution, under [The MIT License](https://opensource.org/licenses/MIT).


DeepChem understands and agrees that Contributor retains copyright in its Contributions. Nothing in this Contributor Agreement shall be interpreted to prohibit Contributor from licensing its Contributions under different terms from the [The MIT License](https://opensource.org/licenses/MIT) or this Contributor Agreement.
+37 −11
Original line number Diff line number Diff line
@@ -56,11 +56,12 @@ possible_hybridization_list = [
    Chem.rdchem.HybridizationType.SP3D2
]
possible_number_radical_e_list = [0, 1, 2]
possible_chirality_list = ['R', 'S']

reference_lists = [
    possible_atom_list, possible_numH_list, possible_valence_list,
    possible_formal_charge_list, possible_number_radical_e_list,
    possible_hybridization_list
    possible_hybridization_list, possible_chirality_list
]

intervals = get_intervals(reference_lists)
@@ -75,7 +76,6 @@ def get_feature_list(atom):
  features[4] = safe_index(possible_number_radical_e_list,
                           atom.GetNumRadicalElectrons())
  features[5] = safe_index(possible_hybridization_list, atom.GetHybridization())

  return features


@@ -111,7 +111,10 @@ def atom_to_id(atom):
  return features_to_id(features, intervals)


def atom_features(atom, bool_id_feat=False, explicit_H=False):
def atom_features(atom,
                  bool_id_feat=False,
                  explicit_H=False,
                  use_chirality=False):
  if bool_id_feat:
    return np.array([atom_to_id(atom)])
  else:
@@ -175,18 +178,31 @@ def atom_features(atom, bool_id_feat=False, explicit_H=False):
    if not explicit_H:
      results = results + one_of_k_encoding_unk(atom.GetTotalNumHs(),
                                                [0, 1, 2, 3, 4])
    if use_chirality:
      try:
        results = results + one_of_k_encoding_unk(
            atom.GetProp('_CIPCode'),
            ['R', 'S']) + [atom.HasProp('_ChiralityPossible')]
      except:
        results = results + [False, False
                            ] + [atom.HasProp('_ChiralityPossible')]

    return np.array(results)


def bond_features(bond):
def bond_features(bond, use_chirality=False):
  bt = bond.GetBondType()
  return np.array([
  bond_feats = [
      bt == Chem.rdchem.BondType.SINGLE, bt == Chem.rdchem.BondType.DOUBLE,
      bt == Chem.rdchem.BondType.TRIPLE, bt == Chem.rdchem.BondType.AROMATIC,
      bond.GetIsConjugated(),
      bond.IsInRing()
  ])
  ]
  if use_chirality:
    bond_feats = bond_feats + one_of_k_encoding_unk(
        str(bond.GetStereo(),
            ["STEREONONE", "STEREOANY", "STEREOZ", "STEREOE"]))
  return np.array(bond_feats)


def pair_features(mol, edge_list, canon_adj_list, bt_len=6,
@@ -249,7 +265,7 @@ def find_distance(a1, num_atoms, canon_adj_list, max_distance=7):
class ConvMolFeaturizer(Featurizer):
  name = ['conv_mol']

  def __init__(self, master_atom=False):
  def __init__(self, master_atom=False, use_chirality=False):
    """
    Parameters
    ----------
@@ -266,11 +282,13 @@ class ConvMolFeaturizer(Featurizer):
    """
    self.dtype = object
    self.master_atom = master_atom
    self.use_chirality = use_chirality

  def _featurize(self, mol):
    """Encodes mol as a ConvMol object."""
    # Get the node features
    idx_nodes = [(a.GetIdx(), atom_features(a)) for a in mol.GetAtoms()]
    idx_nodes = [(a.GetIdx(), atom_features(
        a, use_chirality=self.use_chirality)) for a in mol.GetAtoms()]
    idx_nodes.sort()  # Sort by ind to ensure same order as rd_kit
    idx, nodes = list(zip(*idx_nodes))

@@ -302,7 +320,8 @@ class ConvMolFeaturizer(Featurizer):
class WeaveFeaturizer(Featurizer):
  name = ['weave_mol']

  def __init__(self, graph_distance=True, explicit_H=False):
  def __init__(self, graph_distance=True, explicit_H=False,
               use_chirality=False):
    # Distance is either graph distance(True) or Euclidean distance(False,
    # only support datasets providing Cartesian coordinates)
    self.graph_distance = graph_distance
@@ -310,11 +329,17 @@ class WeaveFeaturizer(Featurizer):
    self.dtype = object
    # If includes explicit hydrogens
    self.explicit_H = explicit_H
    # If uses use_chirality
    self.use_chirality = use_chirality

  def _featurize(self, mol):
    """Encodes mol as a WeaveMol object."""
    # Atom features
    idx_nodes = [(a.GetIdx(), atom_features(a, explicit_H=self.explicit_H))
    idx_nodes = [(a.GetIdx(),
                  atom_features(
                      a,
                      explicit_H=self.explicit_H,
                      use_chirality=self.use_chirality))
                 for a in mol.GetAtoms()]
    idx_nodes.sort()  # Sort by ind to ensure same order as rd_kit
    idx, nodes = list(zip(*idx_nodes))
@@ -326,7 +351,8 @@ class WeaveFeaturizer(Featurizer):
    edge_list = {}
    for b in mol.GetBonds():
      edge_list[tuple(sorted([b.GetBeginAtomIdx(),
                              b.GetEndAtomIdx()]))] = bond_features(b)
                              b.GetEndAtomIdx()]))] = bond_features(
                                  b, use_chirality=self.use_chirality)

    # Get canonical adjacency list
    canon_adj_list = [[] for mol_id in range(len(nodes))]
+1 −0
Original line number Diff line number Diff line
@@ -34,3 +34,4 @@ from deepchem.molnet.dnasim import simulate_single_motif_detection

from deepchem.molnet.run_benchmark import run_benchmark
#from deepchem.molnet.run_benchmark_low_data import run_benchmark_low_data
from deepchem.molnet import run_benchmark_models