Skip to content

Commit

Permalink
Merge pull request #82 from avmarchenko/master
Browse files Browse the repository at this point in the history
Minor fixes removing debug prints and respecting all input args
  • Loading branch information
avmarchenko committed Aug 19, 2016
2 parents 20ebf83 + 520464a commit 95cc3bd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion exatomic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
.. _atomic: https://en.wikipedia.org/wiki/Atomic_units
"""
__exatomic_version__ = (0, 3, 3)
__exatomic_version__ = (0, 3, 4)
__version__ = '.'.join((str(v) for v in __exatomic_version__))


Expand Down
2 changes: 2 additions & 0 deletions exatomic/algorithms/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ def einstein_relation(universe, length='cm', time='s'):
'''
msd = absolute_squared_displacement(universe).mean(axis=1)
t = universe.frame['time'].values
msd *= Length['au', length]**2
t /= Time['ps', time]
return msd / (6 * t)
9 changes: 0 additions & 9 deletions exatomic/algorithms/neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ def nearest_molecules(universe, n, sources, restrictions=None, how='atom',
unis (dict): Dictionary of number of neighbors keys, universe values
"""
source_atoms, other_atoms, source_molecules, other_molecules, n = _slice_atoms_molecules(universe, sources, restrictions, n)
print(source_atoms.shape)
print(other_atoms.shape)
print(source_molecules.shape)
print(other_molecules.shape)
ordered_molecules, ordered_twos = _compute_neighbors_by_atom(universe, source_atoms, other_atoms, source_molecules)
print(ordered_molecules.shape)
unis = {}
if free_boundary == True:
for nn in n:
Expand Down Expand Up @@ -82,21 +77,17 @@ def _slice_atoms_molecules(universe, sources, restrictions, n):
symbols = universe.atom['symbol'].unique()
classification = universe.molecule['classification'].unique()
if all(source in labels for source in sources):
print("all labels")
source_atoms = universe.atom[universe.atom['label'].isin(sources)]
mdx = source_atoms['molecule'].astype(np.int64)
source_molecules = universe.molecule[universe.molecule.index.isin(mdx)]
elif all(source in symbols for source in sources):
print("all symbols")
source_atoms = universe.atom[universe.atom['symbol'].isin(sources)]
mdx = source_atoms['molecule'].astype(np.int64)
source_molecules = universe.molecule[universe.molecule.index.isin(mdx)]
elif all(source in classification for source in sources):
print("all mols")
source_molecules = universe.molecule[universe.molecule['classification'].isin(sources)]
source_atoms = universe.atom[universe.atom['molecule'].isin(source_molecules.index)]
else:
print("all other")
classif = [source for source in sources if source in classification]
syms = [source for source in sources if source in symbols]
lbls = [source for source in sources if source in labels]
Expand Down
2 changes: 2 additions & 0 deletions exatomic/algorithms/pcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,7 @@ def radial_pair_correlation(universe, a, b, dr=0.05, start=1.0, stop=13.0,
glabel = r"$g_\mathrm{" + a + b + r"}(r)$"
nlabel = r"$n_\mathrm{" + a + b + r"}(r)$"
df = pd.DataFrame.from_dict({rlabel: r, glabel: g, nlabel: n})
if window > 1:
df = df.rolling(window=window).mean()
df.set_index(rlabel, inplace=True)
return df
4 changes: 2 additions & 2 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package:
name: exatomic
version: "0.3.3"
version: "0.3.4"

source:
git_rev: v0.3.3
git_rev: v0.3.4
git_url: https://github.com/exa-analytics/exatomic.git

requirements:
Expand Down
7 changes: 3 additions & 4 deletions publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def get_args():
parser = argparse.ArgumentParser(description="Deployment script for Exa Analytics")
parser.add_argument("pkg", nargs="?")
parser.add_argument("version", nargs="?")
parser.add_argument("which_pypi", nargs="?", default="pypi")
return parser.parse_args()


Expand Down Expand Up @@ -119,11 +118,11 @@ def conda_build(pys):
raise Exception("Upload failed with command {}".format(string))


def pypi_build(pypi):
def pypi_build():
"""
Deploy to pypi/pypitest.
"""
string = "python setup.py sdist upload {}".format(pypi)
string = "python setup.py sdist upload"
ret = subprocess.run([string], shell=True, check=True,
stdout=subprocess.PIPE, stdin=subprocess.PIPE)

Expand All @@ -147,5 +146,5 @@ def cleanup():
chk = check(args.pkg, args.version, pys)
if chk:
conda_build(pys)
pypi_build(args.which_pypi)
pypi_build()
cleanup()

0 comments on commit 95cc3bd

Please sign in to comment.