From 230cae10baac7af499fdac3782abb9f4c42a10f6 Mon Sep 17 00:00:00 2001 From: Alex Marchenko Date: Fri, 19 Aug 2016 11:18:18 -0400 Subject: [PATCH 1/3] Fixed bug in publication script --- publish.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/publish.py b/publish.py index 0eb36028c..bec3fa66d 100644 --- a/publish.py +++ b/publish.py @@ -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() @@ -123,7 +122,7 @@ def pypi_build(pypi): """ 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) @@ -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() From 45760d19d641f44f9abd0e095fa00e6f1fb6e8d4 Mon Sep 17 00:00:00 2001 From: Alex Marchenko Date: Fri, 19 Aug 2016 13:13:13 -0400 Subject: [PATCH 2/3] fixed publish.py --- publish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish.py b/publish.py index bec3fa66d..789171104 100644 --- a/publish.py +++ b/publish.py @@ -118,7 +118,7 @@ def conda_build(pys): raise Exception("Upload failed with command {}".format(string)) -def pypi_build(pypi): +def pypi_build(): """ Deploy to pypi/pypitest. """ From e0918d0f82a1d4ba9eccd244023945bf4c0647f2 Mon Sep 17 00:00:00 2001 From: Alex Marchenko Date: Fri, 19 Aug 2016 14:48:11 -0400 Subject: [PATCH 3/3] Removed debug print and updated diffusion and pcf to respect all input args --- exatomic/__init__.py | 2 +- exatomic/algorithms/diffusion.py | 2 ++ exatomic/algorithms/neighbors.py | 9 --------- exatomic/algorithms/pcf.py | 2 ++ meta.yaml | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/exatomic/__init__.py b/exatomic/__init__.py index 1a7a287bf..a9b75a322 100644 --- a/exatomic/__init__.py +++ b/exatomic/__init__.py @@ -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__)) diff --git a/exatomic/algorithms/diffusion.py b/exatomic/algorithms/diffusion.py index afa59220a..4ac7e5c63 100644 --- a/exatomic/algorithms/diffusion.py +++ b/exatomic/algorithms/diffusion.py @@ -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) diff --git a/exatomic/algorithms/neighbors.py b/exatomic/algorithms/neighbors.py index 7b9f75ae2..496eb3607 100644 --- a/exatomic/algorithms/neighbors.py +++ b/exatomic/algorithms/neighbors.py @@ -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: @@ -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] diff --git a/exatomic/algorithms/pcf.py b/exatomic/algorithms/pcf.py index 6998a6868..e739b2d96 100644 --- a/exatomic/algorithms/pcf.py +++ b/exatomic/algorithms/pcf.py @@ -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 diff --git a/meta.yaml b/meta.yaml index 6006a0f42..98c84b5c7 100644 --- a/meta.yaml +++ b/meta.yaml @@ -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: