Skip to content

Commit 95cc3bd

Browse files
authored
Merge pull request #82 from avmarchenko/master
Minor fixes removing debug prints and respecting all input args
2 parents 20ebf83 + 520464a commit 95cc3bd

6 files changed

Lines changed: 10 additions & 16 deletions

File tree

exatomic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
.. _atomic: https://en.wikipedia.org/wiki/Atomic_units
2020
"""
21-
__exatomic_version__ = (0, 3, 3)
21+
__exatomic_version__ = (0, 3, 4)
2222
__version__ = '.'.join((str(v) for v in __exatomic_version__))
2323

2424

exatomic/algorithms/diffusion.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ def einstein_relation(universe, length='cm', time='s'):
3333
'''
3434
msd = absolute_squared_displacement(universe).mean(axis=1)
3535
t = universe.frame['time'].values
36+
msd *= Length['au', length]**2
37+
t /= Time['ps', time]
3638
return msd / (6 * t)

exatomic/algorithms/neighbors.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ def nearest_molecules(universe, n, sources, restrictions=None, how='atom',
4848
unis (dict): Dictionary of number of neighbors keys, universe values
4949
"""
5050
source_atoms, other_atoms, source_molecules, other_molecules, n = _slice_atoms_molecules(universe, sources, restrictions, n)
51-
print(source_atoms.shape)
52-
print(other_atoms.shape)
53-
print(source_molecules.shape)
54-
print(other_molecules.shape)
5551
ordered_molecules, ordered_twos = _compute_neighbors_by_atom(universe, source_atoms, other_atoms, source_molecules)
56-
print(ordered_molecules.shape)
5752
unis = {}
5853
if free_boundary == True:
5954
for nn in n:
@@ -82,21 +77,17 @@ def _slice_atoms_molecules(universe, sources, restrictions, n):
8277
symbols = universe.atom['symbol'].unique()
8378
classification = universe.molecule['classification'].unique()
8479
if all(source in labels for source in sources):
85-
print("all labels")
8680
source_atoms = universe.atom[universe.atom['label'].isin(sources)]
8781
mdx = source_atoms['molecule'].astype(np.int64)
8882
source_molecules = universe.molecule[universe.molecule.index.isin(mdx)]
8983
elif all(source in symbols for source in sources):
90-
print("all symbols")
9184
source_atoms = universe.atom[universe.atom['symbol'].isin(sources)]
9285
mdx = source_atoms['molecule'].astype(np.int64)
9386
source_molecules = universe.molecule[universe.molecule.index.isin(mdx)]
9487
elif all(source in classification for source in sources):
95-
print("all mols")
9688
source_molecules = universe.molecule[universe.molecule['classification'].isin(sources)]
9789
source_atoms = universe.atom[universe.atom['molecule'].isin(source_molecules.index)]
9890
else:
99-
print("all other")
10091
classif = [source for source in sources if source in classification]
10192
syms = [source for source in sources if source in symbols]
10293
lbls = [source for source in sources if source in labels]

exatomic/algorithms/pcf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,7 @@ def radial_pair_correlation(universe, a, b, dr=0.05, start=1.0, stop=13.0,
8888
glabel = r"$g_\mathrm{" + a + b + r"}(r)$"
8989
nlabel = r"$n_\mathrm{" + a + b + r"}(r)$"
9090
df = pd.DataFrame.from_dict({rlabel: r, glabel: g, nlabel: n})
91+
if window > 1:
92+
df = df.rolling(window=window).mean()
9193
df.set_index(rlabel, inplace=True)
9294
return df

meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package:
22
name: exatomic
3-
version: "0.3.3"
3+
version: "0.3.4"
44

55
source:
6-
git_rev: v0.3.3
6+
git_rev: v0.3.4
77
git_url: https://github.com/exa-analytics/exatomic.git
88

99
requirements:

publish.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def get_args():
2222
parser = argparse.ArgumentParser(description="Deployment script for Exa Analytics")
2323
parser.add_argument("pkg", nargs="?")
2424
parser.add_argument("version", nargs="?")
25-
parser.add_argument("which_pypi", nargs="?", default="pypi")
2625
return parser.parse_args()
2726

2827

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

121120

122-
def pypi_build(pypi):
121+
def pypi_build():
123122
"""
124123
Deploy to pypi/pypitest.
125124
"""
126-
string = "python setup.py sdist upload {}".format(pypi)
125+
string = "python setup.py sdist upload"
127126
ret = subprocess.run([string], shell=True, check=True,
128127
stdout=subprocess.PIPE, stdin=subprocess.PIPE)
129128

@@ -147,5 +146,5 @@ def cleanup():
147146
chk = check(args.pkg, args.version, pys)
148147
if chk:
149148
conda_build(pys)
150-
pypi_build(args.which_pypi)
149+
pypi_build()
151150
cleanup()

0 commit comments

Comments
 (0)