From 75aded8c74db42cd65471a738aaa760328d07926 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Mon, 15 Jul 2024 19:42:12 -0700 Subject: [PATCH 01/21] moved version requirement up to 3.10, fixed tests for cross-platform --- .github/workflows/python-app.yml | 2 +- ElliptiCBn/core.py | 9 +++++++-- requirements.txt | 2 +- setup.py | 4 +--- tests/conftest.py | 6 ++++++ tests/test_core.py | 6 +++--- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index c86397b..42a945f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -17,7 +17,7 @@ jobs: max-parallel: 3 matrix: os: [ubuntu-latest,macos-latest,windows-latest] - python-version: ['3.7', '3.8', '3.9', '3.10' , '3.11', '3.12'] + python-version: ['3.9', '3.10' , '3.11', '3.12'] steps: - uses: actions/checkout@v4 diff --git a/ElliptiCBn/core.py b/ElliptiCBn/core.py index 3d516cd..6dcf7dd 100644 --- a/ElliptiCBn/core.py +++ b/ElliptiCBn/core.py @@ -196,8 +196,6 @@ def get_macrocycles(filename, univ = mda.Universe("tmp-xyz.xyz", guess_bonds=True) - os.remove("tmp-xyz.xyz") - out = {"atom_index":[], "atom_type":[], "x":[], @@ -229,6 +227,13 @@ def get_macrocycles(filename, out["neighbors"].append(neighbors) out["neigh_pattern"].append("".join(neighbor_elem)) + # Try to delete temporary file. May fail on windows because mdanalysis + # keeps file pointer open and locks file + try: + os.remove("tmp-xyz.xyz") + except PermissionError: + pass + atom_df = pd.DataFrame(out) molecules = nx.strongly_connected_components(G) molecules = [np.array(list(m),dtype=int) for m in molecules] diff --git a/requirements.txt b/requirements.txt index 54eb981..f32cdd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ pandas matplotlib xlsxwriter mdanalysis -scipy +scipy \ No newline at end of file diff --git a/setup.py b/setup.py index 022cd32..feefefa 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ URL = "https://github.com/harmslab/ElliptiCBn" EMAIL = "harms@uoregon.edu; mshavlik@uoregon.edu" AUTHOR = "Michael J. Harms; Michael Shavlik" -REQUIRES_PYTHON = ">=3.7.0" +REQUIRES_PYTHON = ">=3.9.0" about = {} here = os.path.abspath(os.path.dirname(__file__)) @@ -49,8 +49,6 @@ keywords='CBn; cucurbituril; host; guest; chemistry; molecule; science; analysis; crystal structure', classifiers = ["Development Status :: 3 - Alpha", 'Intended Audience :: Science/Research', - 'Programming Language :: Python :: 3.7' - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', diff --git a/tests/conftest.py b/tests/conftest.py index 93d3e71..af686e3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -76,6 +76,12 @@ def get_files(base_dir): new_key.append("") output["/".join(new_key)] = os.path.join(root,this_dir) + # make sure output is sorted stably + for k in output: + new_output = list(output[k]) + new_output.sort() + output[k] = new_output + return output @pytest.fixture(scope="module") diff --git a/tests/test_core.py b/tests/test_core.py index a54f98b..bf69a59 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -69,8 +69,8 @@ def test_calc_ellipticity(): def test_get_macrocycles(example_xyz): - counter_expect = [np.array([0,np.nan]), - np.array([0,1,np.nan])] + counter_expect = [np.array([0,1,np.nan]), + np.array([0,np.nan]),] for counter, xyz in enumerate(example_xyz["*.xyz"]): @@ -112,7 +112,7 @@ def test_get_ellipticity(example_xyz,tmpdir): cwd = os.getcwd() os.chdir(tmpdir) - counter_expect = [1,2] + counter_expect = [2,1] for counter, xyz in enumerate(example_xyz["*.xyz"]): atom_df = get_macrocycles(xyz) From 2e575c56635b01bc874f889399ae806073f2a9ad Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Mon, 15 Jul 2024 19:58:44 -0700 Subject: [PATCH 02/21] updated test_script to handle windows call --- tests/test_script.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/tests/test_script.py b/tests/test_script.py index 98771c6..537d704 100644 --- a/tests/test_script.py +++ b/tests/test_script.py @@ -3,12 +3,22 @@ import os import subprocess +import platform + def test_script(example_xyz,tmpdir): """ Basic test of the command line script. """ + # Update test for windows + if platform.architecture == "Windows": + here = os.path.abspath(os.path.dirname(__file__)) + script = os.path.realpath(os.path.join(here,"..","bin","ElliptiCBn")) + base_cmd = ["python",script] + else: + base_cmd = ["ElliptiCBn"] + cwd = os.getcwd() os.chdir(tmpdir) @@ -21,7 +31,8 @@ def test_script(example_xyz,tmpdir): expected.append(out_html) expected.append(out_xlsx) - cmd = ["ElliptiCBn",xyz] + cmd = base_cmd[:] + cmd.append(xyz) results = subprocess.run(cmd) assert results.returncode == 0 assert os.path.isfile(out_html) @@ -30,7 +41,8 @@ def test_script(example_xyz,tmpdir): os.remove(out_html) os.remove(out_xlsx) - cmd = ["ElliptiCBn",*example_xyz["*.xyz"]] + cmd = base_cmd[:] + cmd.extend(example_xyz["*.xyz"]) results = subprocess.run(cmd) assert results.returncode == 0 @@ -38,7 +50,8 @@ def test_script(example_xyz,tmpdir): assert set(os.listdir(".")) == set(expected) # make sure we can write to a directory - cmd = ["ElliptiCBn",*example_xyz["*.xyz"]] + cmd = base_cmd[:] + cmd.extend(example_xyz["*.xyz"]) cmd.extend(["--output_dir","multi"]) results = subprocess.run(cmd) assert results.returncode == 0 @@ -46,7 +59,8 @@ def test_script(example_xyz,tmpdir): assert set(os.listdir("multi")) == set(expected) # Should fail -- output exists - cmd = ["ElliptiCBn",*example_xyz["*.xyz"]] + cmd = base_cmd[:] + cmd.extend(example_xyz["*.xyz"]) cmd.extend(["--output_dir","multi"]) results = subprocess.run(cmd) assert results.returncode == 1 @@ -56,22 +70,20 @@ def test_script(example_xyz,tmpdir): results = subprocess.run(cmd) assert results.returncode == 0 - - cmd = ["ElliptiCBn",example_xyz["*.xyz"][0]] + cmd = base_cmd[:] + cmd.append(example_xyz["*.xyz"][0]) cmd.extend(["--min_num_carbons","1000"]) cmd.extend(["--max_num_carbons","20"]) results = subprocess.run(cmd) assert results.returncode == 1 - cmd = ["ElliptiCBn",example_xyz["*.xyz"][0]] + cmd = base_cmd[:] + cmd.append(example_xyz["*.xyz"][0]) cmd.extend(["--min_num_carbons","20"]) cmd.extend(["--max_num_carbons","2"]) results = subprocess.run(cmd) assert results.returncode == 1 - - - os.chdir(cwd) From 9b8c97dd5a5d82ba9b57e58c2bf0460d99803190 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Mon, 15 Jul 2024 20:20:10 -0700 Subject: [PATCH 03/21] fixed test --- tests/test_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_script.py b/tests/test_script.py index 537d704..6175bb0 100644 --- a/tests/test_script.py +++ b/tests/test_script.py @@ -12,7 +12,7 @@ def test_script(example_xyz,tmpdir): """ # Update test for windows - if platform.architecture == "Windows": + if platform.system() == "Windows": here = os.path.abspath(os.path.dirname(__file__)) script = os.path.realpath(os.path.join(here,"..","bin","ElliptiCBn")) base_cmd = ["python",script] From b80fdb300ba0be846f024803a4f9e4c7715ca21e Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Mon, 15 Jul 2024 21:12:41 -0700 Subject: [PATCH 04/21] still trying to get windows test to work --- tests/test_script.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_script.py b/tests/test_script.py index 6175bb0..ffe980d 100644 --- a/tests/test_script.py +++ b/tests/test_script.py @@ -56,7 +56,12 @@ def test_script(example_xyz,tmpdir): results = subprocess.run(cmd) assert results.returncode == 0 assert os.path.isdir("multi") - assert set(os.listdir("multi")) == set(expected) + + # Make sure the right files are spit out (less a temporary file that might + # not be deleted) + seen = set(os.listdir("multi")) + seen = seen - set(["tmp-xyz.xyz"]) + assert seen == set(expected) # Should fail -- output exists cmd = base_cmd[:] From b278408bd58582d77325dd7904e1da57c9eb6a4a Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Mon, 15 Jul 2024 21:21:10 -0700 Subject: [PATCH 05/21] still, still working on windows --- tests/test_script.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_script.py b/tests/test_script.py index ffe980d..8b3723b 100644 --- a/tests/test_script.py +++ b/tests/test_script.py @@ -47,7 +47,9 @@ def test_script(example_xyz,tmpdir): assert results.returncode == 0 expected.append("summary.xlsx") - assert set(os.listdir(".")) == set(expected) + seen = set(os.listdir(".")) + seen = seen - set(["tmp-xyz.xyz"]) + assert seen == set(expected) # make sure we can write to a directory cmd = base_cmd[:] From 10b5758f0aa75daa2bc1d6f83348e626ffe7feba Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 09:32:27 -0700 Subject: [PATCH 06/21] switched to pyproject.toml from setup.py/requirements.txt --- ElliptiCBn/run_all.py | 82 ++++++++++++++++++++++++++++++++++++++- bin/ElliptiCBn | 90 ------------------------------------------- pyproject.toml | 49 +++++++++++++++++++++++ requirements.txt | 9 ----- setup.py | 56 --------------------------- 5 files changed, 130 insertions(+), 156 deletions(-) delete mode 100755 bin/ElliptiCBn create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/ElliptiCBn/run_all.py b/ElliptiCBn/run_all.py index cb34a94..3b56367 100644 --- a/ElliptiCBn/run_all.py +++ b/ElliptiCBn/run_all.py @@ -4,10 +4,16 @@ from .core import plot_results from .core import get_macrocycles from .core import get_ellipticity +from .__version__ import __version__ import pandas as pd import os +import argparse +import inspect +import re +import sys + def _file_check(some_file, output_dir=".", @@ -164,4 +170,78 @@ def run_all(filename, return None - return fig \ No newline at end of file + return fig + +def main_cli(argv=None,description=None): + """ + Run ellipticbn, building command line arguments based on docstring and + argument datatypes. + """ + + fcn = run_all + optional_arg_types = {} + + if argv is None: + argv = sys.argv[1:] + + # Get program name + prog = "ElliptiCBn" + + # Get description + if description is None: + description = dict(inspect.getmembers(fcn))["__doc__"] + description = re.sub(":code:","",description) + + # Build parser + parser = argparse.ArgumentParser(prog=prog, + description=description, + formatter_class=argparse.RawTextHelpFormatter) + + # Build parser arguments using signature of fcn + param = inspect.signature(fcn).parameters + for p in param: + + if p == "filename": + parser.add_argument(p,nargs="+") + continue + + # If no default specified, make required and move on. + if param[p].default is param[p].empty: + parser.add_argument(p) + continue + + # For default is None args, parse as optional_arg_types or str + if param[p].default is None: + try: + arg_type = optional_arg_types[p] + except KeyError: + arg_type = str + + # Otherwise, just grab the type + else: + arg_type = type(param[p].default) + + # bool + kwargs = {} + if arg_type is bool: + if param[p].default is True: + kwargs["action"] = "store_false" + else: + kwargs["action"] = "store_true" + + # any other argument type + else: + kwargs["type"] = arg_type + kwargs["default"] = param[p].default + + parser.add_argument(f"--{p}",**kwargs) + + parser.add_argument('--version', + action='version', + version=f'{prog} {__version__}') + + # Parse args + args = parser.parse_args(argv) + + # Call function with fcn_args + _ = fcn(**args.__dict__) diff --git a/bin/ElliptiCBn b/bin/ElliptiCBn deleted file mode 100755 index 990e0ea..0000000 --- a/bin/ElliptiCBn +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python -""" -Command line interface for ElliptiCBn. -""" - -import ElliptiCBn -from ElliptiCBn import run_all - -import sys -import inspect -import argparse -import re - -def main(argv=None,description=None): - """ - Run ellipticbn, building command line arguments based on docstring and - argument datatypes. - """ - - fcn = run_all - optional_arg_types = {} - - if argv is None: - argv = sys.argv[1:] - - # Get program name - prog = "ElliptiCBn" - - # Get description - if description is None: - description = dict(inspect.getmembers(fcn))["__doc__"] - description = re.sub(":code:","",description) - - # Build parser - parser = argparse.ArgumentParser(prog=prog, - description=description, - formatter_class=argparse.RawTextHelpFormatter) - - # Build parser arguments using signature of fcn - param = inspect.signature(fcn).parameters - for p in param: - - if p == "filename": - parser.add_argument(p,nargs="+") - continue - - # If no default specified, make required and move on. - if param[p].default is param[p].empty: - parser.add_argument(p) - continue - - # For default is None args, parse as optional_arg_types or str - if param[p].default is None: - try: - arg_type = optional_arg_types[p] - except KeyError: - arg_type = str - - # Otherwise, just grab the type - else: - arg_type = type(param[p].default) - - # bool - kwargs = {} - if arg_type is bool: - if param[p].default is True: - kwargs["action"] = "store_false" - else: - kwargs["action"] = "store_true" - - # any other argument type - else: - kwargs["type"] = arg_type - kwargs["default"] = param[p].default - - parser.add_argument(f"--{p}",**kwargs) - - parser.add_argument('--version', - action='version', - version=f'{prog} {ElliptiCBn.__version__}') - - # Parse args - args = parser.parse_args(argv) - - # Call function with fcn_args - _ = fcn(**args.__dict__) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4f3b605 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,49 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" +#requires = ["hatchling"] +#build-backend = "hatchling.build" + +[tool.setuptools] +packages = ["ElliptiCBn"] + +[project] +name = "ellipticbn" +dynamic = ["version"] +dependencies = [ + "numpy>=1.10", + "networkx", + "scikit-learn", + "plotly", + "pandas", + "matplotlib", + "xlsxwriter", + "mdanalysis", + "scipy" +] + + + +requires-python = ">=3.9" +authors = [ + {name = "Michael Shavlik", email = "mshavlik@uoregon.edu"}, + {name = "Mike Harms", email = "harms@uoregon.edu"}, +] +maintainers = [ + {name = "Mike Harms", email = "harms@uoregon.edu"} +] +description = "Automatically measure the ellipticity of cucurbituril macrocycles!" +readme = "README.md" +license = {file = "LICENSE"} +keywords = ["macrocycle", "cucurbituril", "ellipticity", "chemistry", "geometry", "host", "guest"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python" +] + +[project.urls] +Repository = "https://github.com/harmslab/ElliptiCBn.git" +"Bug Tracker" = "https://github.com/harmslab/ElliptiCBn/issues" + +[project.scripts] +ElliptiCBn = "ElliptiCBn.run_all:main_cli" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f32cdd8..0000000 --- a/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -numpy>=1.10 -networkx -scikit-learn -plotly -pandas -matplotlib -xlsxwriter -mdanalysis -scipy \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index feefefa..0000000 --- a/setup.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python3 -# coding: utf-8 - -import io -import os -import glob - -from setuptools import find_packages -from setuptools import setup - -# name of package ElliptiCBn - -#Package meta-data -DESCRIPTION= \ -""" Python package for analyzing ellipticity in CBn crystal structures. """ -URL = "https://github.com/harmslab/ElliptiCBn" -EMAIL = "harms@uoregon.edu; mshavlik@uoregon.edu" -AUTHOR = "Michael J. Harms; Michael Shavlik" -REQUIRES_PYTHON = ">=3.9.0" - -about = {} -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, "ElliptiCBn", '__version__.py')) as f: - exec(f.read(),about) - -# Import README for description -with io.open(os.path.join(here,'README.md'),encoding='utf-8') as f: - full_description = '\n' + f.read() - -packages = find_packages() -package_data = {"":["ElliptiCBn/data/*.csv", - "ElliptiCBn/data/*.txt", - "notebooks/*.ipynb"]} - -# Now the part where we do setup -setup( - name='ElliptiCBn', - version=about["__version__"], - author=AUTHOR, - author_email=EMAIL, - description=DESCRIPTION, - long_description=full_description, - url=URL, - license='MIT', - packages=packages, - package_data=package_data, - include_package_data=True, - scripts=glob.glob("bin/*"), - keywords='CBn; cucurbituril; host; guest; chemistry; molecule; science; analysis; crystal structure', - classifiers = ["Development Status :: 3 - Alpha", - 'Intended Audience :: Science/Research', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12'], - zip_safe=False) From 2ab6c557e78154e234b35fb54695d01657a3546c Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 09:38:31 -0700 Subject: [PATCH 07/21] adding automatic wheel building --- .github/workflows/wheels.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..ddc4339 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,32 @@ +name: Build + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-14] #ubuntu-latest, windows-latest, macos-13, + python-version: ['3.12'] # '3.9', '3.10' , '3.11', + + steps: + - uses: actions/checkout@v4 + + # Used to host cibuildwheel + - uses: actions/setup-python@v5 + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.19.2 + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + # to supply options, put them in 'env', like: + # env: + # CIBW_SOME_OPTION: value + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl From 883824f371f26f0ae3a9da038308186a0a0cb3dd Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 09:59:09 -0700 Subject: [PATCH 08/21] fixing wheel workflow --- .github/workflows/python-app.yml | 2 +- .github/workflows/wheels.yml | 3 +-- ElliptiCBn/__version__.py | 2 +- notebooks/ElliptiCBn.ipynb | 2 +- pyproject.toml | 3 +++ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 42a945f..d6badeb 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -28,7 +28,7 @@ jobs: - name: install ElliptiCBn run: | # platform specific packages - python -m pip install . -vv -r requirements.txt + python -m pip install . -vv pyproject.toml - name: run flake8 run: | diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ddc4339..a9cd596 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -4,12 +4,11 @@ on: [push, pull_request] jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} ${{ matrix.python-version }} + name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-14] #ubuntu-latest, windows-latest, macos-13, - python-version: ['3.12'] # '3.9', '3.10' , '3.11', steps: - uses: actions/checkout@v4 diff --git a/ElliptiCBn/__version__.py b/ElliptiCBn/__version__.py index 57747a6..71e9997 100644 --- a/ElliptiCBn/__version__.py +++ b/ElliptiCBn/__version__.py @@ -1,3 +1,3 @@ VERSION = (2, 0, 2) -__version__ = '.'.join(map(str, VERSION)) \ No newline at end of file +__version__ = '.'.join(map(str, VERSION)) diff --git a/notebooks/ElliptiCBn.ipynb b/notebooks/ElliptiCBn.ipynb index d760cd3..bb9a512 100644 --- a/notebooks/ElliptiCBn.ipynb +++ b/notebooks/ElliptiCBn.ipynb @@ -75,7 +75,7 @@ "if RUNNING_IN_COLAB:\n", " !git clone https://github.com/harmslab/ElliptiCBn\n", " %cd ElliptiCBn\n", - " %pip install . -r requirements.txt\n", + " %pip install . pyproject.toml \n", "\n", "# ------------------------------------------------------------------------------\n", "# Imports\n", diff --git a/pyproject.toml b/pyproject.toml index 4f3b605..5ffe2ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,9 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = ["ElliptiCBn"] +[tool.distutils.bdist_wheel] +universal = true + [project] name = "ellipticbn" dynamic = ["version"] From 7460c57b9815a96ed21b14ef9d75ae4f4125ace2 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 10:01:05 -0700 Subject: [PATCH 09/21] troubleshooting wheel --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a9cd596..71514ba 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -20,7 +20,7 @@ jobs: run: python -m pip install cibuildwheel==2.19.2 - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse + run: pip wheel -w wheelhouse . #python -m cibuildwheel --output-dir wheelhouse # to supply options, put them in 'env', like: # env: # CIBW_SOME_OPTION: value From 482782e01b30bce8cf8d966dd137560f761c85c8 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 10:04:03 -0700 Subject: [PATCH 10/21] finalizing wheel building --- .github/workflows/wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 71514ba..729a30a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,7 +8,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-14] #ubuntu-latest, windows-latest, macos-13, + python-version: ['3.9', '3.10' , '3.11', '3.12'] + os: [macos-14, ubuntu-latest, windows-latest, macos-13] steps: - uses: actions/checkout@v4 From 47cd772966045dcae13cc082c7487a32a90647ca Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 10:07:02 -0700 Subject: [PATCH 11/21] finalizing wheel builds --- .github/workflows/wheels.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 729a30a..35ce6db 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -21,12 +21,9 @@ jobs: run: python -m pip install cibuildwheel==2.19.2 - name: Build wheels - run: pip wheel -w wheelhouse . #python -m cibuildwheel --output-dir wheelhouse - # to supply options, put them in 'env', like: - # env: - # CIBW_SOME_OPTION: value + run: pip wheel -w wheelhouse . - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + name: ellipticbn-wheels-${{ matrix.python-version }}-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl From 31d9154cb0145e9c9caf6cd379904d354f0497a1 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 11:13:33 -0700 Subject: [PATCH 12/21] build now works for pypi with version --- .github/workflows/wheels.yml | 29 ----------------------------- ElliptiCBn/__version__.py | 2 +- MANIFEST.in | 5 ----- pyproject.toml | 7 +++---- 4 files changed, 4 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/wheels.yml delete mode 100644 MANIFEST.in diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml deleted file mode 100644 index 35ce6db..0000000 --- a/.github/workflows/wheels.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ['3.9', '3.10' , '3.11', '3.12'] - os: [macos-14, ubuntu-latest, windows-latest, macos-13] - - steps: - - uses: actions/checkout@v4 - - # Used to host cibuildwheel - - uses: actions/setup-python@v5 - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.19.2 - - - name: Build wheels - run: pip wheel -w wheelhouse . - - - uses: actions/upload-artifact@v4 - with: - name: ellipticbn-wheels-${{ matrix.python-version }}-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl diff --git a/ElliptiCBn/__version__.py b/ElliptiCBn/__version__.py index 71e9997..24f5173 100644 --- a/ElliptiCBn/__version__.py +++ b/ElliptiCBn/__version__.py @@ -1,3 +1,3 @@ -VERSION = (2, 0, 2) +VERSION = (2, 1, 2) __version__ = '.'.join(map(str, VERSION)) diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index b039e29..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include requirements.txt -include ElliptiCBn/data/ -include ElliptiCBn/data/*.csv -include ElliptiCBn/data/*.txt -include notebooks/*.ipynb diff --git a/pyproject.toml b/pyproject.toml index 5ffe2ed..30adc53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,6 @@ [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" -#requires = ["hatchling"] -#build-backend = "hatchling.build" [tool.setuptools] packages = ["ElliptiCBn"] @@ -10,6 +8,9 @@ packages = ["ElliptiCBn"] [tool.distutils.bdist_wheel] universal = true +[tool.setuptools.dynamic] +version = {attr = "ElliptiCBn.__version__.__version__"} + [project] name = "ellipticbn" dynamic = ["version"] @@ -25,8 +26,6 @@ dependencies = [ "scipy" ] - - requires-python = ">=3.9" authors = [ {name = "Michael Shavlik", email = "mshavlik@uoregon.edu"}, From 106b8785bf786294ed281ec60806f4857d659910 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 11:17:17 -0700 Subject: [PATCH 13/21] updated windows test script for ci --- tests/test_script.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_script.py b/tests/test_script.py index 8b3723b..9402c9f 100644 --- a/tests/test_script.py +++ b/tests/test_script.py @@ -11,13 +11,13 @@ def test_script(example_xyz,tmpdir): Basic test of the command line script. """ - # Update test for windows - if platform.system() == "Windows": - here = os.path.abspath(os.path.dirname(__file__)) - script = os.path.realpath(os.path.join(here,"..","bin","ElliptiCBn")) - base_cmd = ["python",script] - else: - base_cmd = ["ElliptiCBn"] + # # Update test for windows + # if platform.system() == "Windows": + # here = os.path.abspath(os.path.dirname(__file__)) + # script = os.path.realpath(os.path.join(here,"..","bin","ElliptiCBn")) + # base_cmd = ["python",script] + # else: + base_cmd = ["ElliptiCBn"] cwd = os.getcwd() os.chdir(tmpdir) From 873d9d8de24592efb5eee9075d46c9426d92f83e Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 11:29:41 -0700 Subject: [PATCH 14/21] updated package declaration in toml --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 30adc53..0de61e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,9 @@ universal = true [tool.setuptools.dynamic] version = {attr = "ElliptiCBn.__version__.__version__"} +[tool.setuptools.package-data] +mypkg = ["*.csv","*.txt"] + [project] name = "ellipticbn" dynamic = ["version"] From 3724ba1d5acd7be09b9d5a12a538bbe0152c8709 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 11:34:50 -0700 Subject: [PATCH 15/21] still troubleshooting package-data --- .github/workflows/python-app.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index d6badeb..81dc3ad 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -28,7 +28,7 @@ jobs: - name: install ElliptiCBn run: | # platform specific packages - python -m pip install . -vv pyproject.toml + python -m pip install . pyproject.toml - name: run flake8 run: | diff --git a/pyproject.toml b/pyproject.toml index 0de61e7..7bef5b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ universal = true version = {attr = "ElliptiCBn.__version__.__version__"} [tool.setuptools.package-data] -mypkg = ["*.csv","*.txt"] +include = ["data/*.*"] [project] name = "ellipticbn" From 12541f70e5f063255fb6afc24decec0cc41a0acc Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 11:41:06 -0700 Subject: [PATCH 16/21] still troubleshooing package include --- .github/workflows/python-app.yml | 1 - pyproject.toml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 81dc3ad..0a1c361 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -14,7 +14,6 @@ jobs: runs-on: ${{ matrix.os }} strategy: fail-fast: false - max-parallel: 3 matrix: os: [ubuntu-latest,macos-latest,windows-latest] python-version: ['3.9', '3.10' , '3.11', '3.12'] diff --git a/pyproject.toml b/pyproject.toml index 7bef5b5..0782c57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = ["ElliptiCBn"] +include-package-data = true [tool.distutils.bdist_wheel] universal = true From 6fd44cbcdcc5cc5b54caaad1de96967d105feccd Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 11:43:13 -0700 Subject: [PATCH 17/21] package-data still not working --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0782c57..9f9396e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ universal = true version = {attr = "ElliptiCBn.__version__.__version__"} [tool.setuptools.package-data] -include = ["data/*.*"] +include = ["*.txt","*.csv"] [project] name = "ellipticbn" From 33078350d52b1900088a782651a612c83a9dc051 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 11:51:43 -0700 Subject: [PATCH 18/21] still working on package-data --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9f9396e..c79bf7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ universal = true version = {attr = "ElliptiCBn.__version__.__version__"} [tool.setuptools.package-data] -include = ["*.txt","*.csv"] +ElliptiCBn = ["*.txt","*.csv"] [project] name = "ellipticbn" From fa8b59ff4968628ec2aa80ccec469426246b4547 Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 12:02:40 -0700 Subject: [PATCH 19/21] fixed package-data --- MANIFEST.in | 3 +++ pyproject.toml | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..79a7b61 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include ElliptiCBn/data/ +include ElliptiCBn/data/*.csv +include ElliptiCBn/data/*.txt diff --git a/pyproject.toml b/pyproject.toml index c79bf7b..c0c3768 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = ["ElliptiCBn"] -include-package-data = true [tool.distutils.bdist_wheel] universal = true @@ -13,7 +12,10 @@ universal = true version = {attr = "ElliptiCBn.__version__.__version__"} [tool.setuptools.package-data] -ElliptiCBn = ["*.txt","*.csv"] +"*" = [ + "ElliptiCBn/data/*.txt", + "ElliptiCBn/data/*.csv" +] [project] name = "ellipticbn" From 89de9a83af1a41aa7fffda614b984377647b55aa Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 13:51:23 -0700 Subject: [PATCH 20/21] reorganizing with lowercase letters and src --- .github/workflows/python-app.yml | 4 ++-- MANIFEST.in | 6 ++--- README.md | 18 +++++++-------- notebooks/{ElliptiCBn.ipynb => ellipticbn.py} | 12 +++++----- pyproject.toml | 22 +++++++++++-------- run_all_tests.sh | 2 +- {ElliptiCBn => src/ellipticbn}/__init__.py | 0 {ElliptiCBn => src/ellipticbn}/__version__.py | 0 {ElliptiCBn => src/ellipticbn}/core.py | 4 ++-- .../ellipticbn}/data/atom-colors.csv | 0 .../ellipticbn}/data/palette-colors.txt | 0 {ElliptiCBn => src/ellipticbn}/run_all.py | 2 +- tests/{ => ellipticbn}/conftest.py | 0 .../data/example-xyz/BATWAW.xyz | 0 .../data/example-xyz/GAFYIW.xyz | 0 tests/{ => ellipticbn}/test_core.py | 10 ++++----- tests/{ => ellipticbn}/test_run_all.py | 4 ++-- tests/{ => ellipticbn}/test_script.py | 9 +------- 18 files changed, 45 insertions(+), 48 deletions(-) rename notebooks/{ElliptiCBn.ipynb => ellipticbn.py} (96%) rename {ElliptiCBn => src/ellipticbn}/__init__.py (100%) rename {ElliptiCBn => src/ellipticbn}/__version__.py (100%) rename {ElliptiCBn => src/ellipticbn}/core.py (99%) rename {ElliptiCBn => src/ellipticbn}/data/atom-colors.csv (100%) rename {ElliptiCBn => src/ellipticbn}/data/palette-colors.txt (100%) rename {ElliptiCBn => src/ellipticbn}/run_all.py (99%) rename tests/{ => ellipticbn}/conftest.py (100%) rename tests/{ => ellipticbn}/data/example-xyz/BATWAW.xyz (100%) rename tests/{ => ellipticbn}/data/example-xyz/GAFYIW.xyz (100%) rename tests/{ => ellipticbn}/test_core.py (95%) rename tests/{ => ellipticbn}/test_run_all.py (97%) rename tests/{ => ellipticbn}/test_script.py (87%) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0a1c361..dad09c8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and flake8 across # platforms and python versions. -name: ElliptiCBn +name: ellipticbn on: push: @@ -24,7 +24,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: install ElliptiCBn + - name: install ellipticbn run: | # platform specific packages python -m pip install . pyproject.toml diff --git a/MANIFEST.in b/MANIFEST.in index 79a7b61..bfd1a61 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ -include ElliptiCBn/data/ -include ElliptiCBn/data/*.csv -include ElliptiCBn/data/*.txt +include src/ellipticbn/data/ +include src/ellipticbn/data/*.csv +include src/ellipticbn/data/*.txt diff --git a/README.md b/README.md index 6cf458b..7687c01 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Run the program in the cloud without installing any software. -Open In Colab +Open In Colab @@ -83,7 +83,7 @@ ElliptiCB[n] can be installed locally and used as a command line tool. On a terminal, run: ```bash -pip install ElliptiCBn +pip install ellipticbn ``` **To install from source:** @@ -91,9 +91,9 @@ pip install ElliptiCBn On a terminal, run: ```bash -git clone https://github.com/harmslab/ElliptiCBn.git -cd ElliptiCBn -python -m pip install . -vv -r requirements.txt +git clone https://github.com/harmslab/ellipticbn.git +cd ellipticbn +python -m pip install . pyproject.toml ``` ### Run from the command line @@ -101,7 +101,7 @@ python -m pip install . -vv -r requirements.txt ElliptiCB[n] takes one or more .xyz files as inputs. Assuming that HUMAR.xyz is in the working directory, running this command: ``` -$> ElliptiCBn HUMXAR.xyz +$> ellipticbn HUMXAR.xyz ``` Would generate the following output: @@ -126,7 +126,7 @@ It will also generate HUXMAR.xyz.html (the visualization) and HUXMAR.xyz.xlsx (t You can also run the program on multiple xyz files: ``` -$> ElliptiCBn HUMXAR.xyz LAZPIM.xyz +$> ellipticbn HUMXAR.xyz LAZPIM.xyz ``` Would generate the following output: @@ -169,13 +169,13 @@ In addition to the visualization html and individual ellipiticty files, this cal One can also change the parameters used in the calculation. To see the available options, type the following in a terminal: ```bash -ElliptiCBn --help +ellipticbn --help ``` As of this writing (version 2.0.1), this gives the following output: ``` -usage: ElliptiCBn [-h] [--min_num_carbons MIN_NUM_CARBONS] +usage: ellipticbn [-h] [--min_num_carbons MIN_NUM_CARBONS] [--max_num_carbons MAX_NUM_CARBONS] [--guest_search_radius GUEST_SEARCH_RADIUS] [--summary_file SUMMARY_FILE] [--output_dir OUTPUT_DIR] diff --git a/notebooks/ElliptiCBn.ipynb b/notebooks/ellipticbn.py similarity index 96% rename from notebooks/ElliptiCBn.ipynb rename to notebooks/ellipticbn.py index bb9a512..8cd73c5 100644 --- a/notebooks/ElliptiCBn.ipynb +++ b/notebooks/ellipticbn.py @@ -8,7 +8,7 @@ "tags": [] }, "source": [ - "# Use ElliptiCBn to measure the ellipticity of cucurbituril hosts\n", + "# Use ellipticbn to measure the ellipticity of cucurbituril hosts\n", "\n", "\n", "### Description\n", @@ -21,7 +21,7 @@ "\n", "\n", "\n", - "#### ElliptiCBn performs the following steps\n", + "#### ellipticbn performs the following steps\n", "\n", "\n", "\n", @@ -58,7 +58,7 @@ "source": [ "#@title Set up environment\n", "\n", - "#@markdown This cell configures the computing environment to run ElliptiCBn. Run\n", + "#@markdown This cell configures the computing environment to run ellipticbn. Run\n", "#@markdown this cell before uploading an XYZ file.\n", "\n", "#@markdown To run the cell, click the \"Play\" button to the left.\n", @@ -73,14 +73,14 @@ " raise Exception(err) from e\n", "\n", "if RUNNING_IN_COLAB:\n", - " !git clone https://github.com/harmslab/ElliptiCBn\n", - " %cd ElliptiCBn\n", + " !git clone https://github.com/harmslab/ellipticbn\n", + " %cd ellipticbn\n", " %pip install . pyproject.toml \n", "\n", "# ------------------------------------------------------------------------------\n", "# Imports\n", "\n", - "import ElliptiCBn as ec\n", + "import ellipticbn as ec\n", "\n", "import numpy as np\n", "import pandas as pd\n", diff --git a/pyproject.toml b/pyproject.toml index c0c3768..a5f4393 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,19 +2,16 @@ requires = ["setuptools"] build-backend = "setuptools.build_meta" -[tool.setuptools] -packages = ["ElliptiCBn"] - [tool.distutils.bdist_wheel] universal = true [tool.setuptools.dynamic] -version = {attr = "ElliptiCBn.__version__.__version__"} +version = {attr = "ellipticbn.__version__.__version__"} [tool.setuptools.package-data] "*" = [ - "ElliptiCBn/data/*.txt", - "ElliptiCBn/data/*.csv" + "src/ellipticbn/data/*.txt", + "src/ellipticbn/data/*.csv" ] [project] @@ -50,8 +47,15 @@ classifiers = [ ] [project.urls] -Repository = "https://github.com/harmslab/ElliptiCBn.git" -"Bug Tracker" = "https://github.com/harmslab/ElliptiCBn/issues" +Repository = "https://github.com/harmslab/ellipticbn.git" +"Bug Tracker" = "https://github.com/harmslab/ellipticbn/issues" [project.scripts] -ElliptiCBn = "ElliptiCBn.run_all:main_cli" +ellipticbn = "ellipticbn.run_all:main_cli" + +[project.optional-dependencies] +test = [ + "coverage", + "flake8", + "pytest" + ] diff --git a/run_all_tests.sh b/run_all_tests.sh index 41e1352..a168446 100755 --- a/run_all_tests.sh +++ b/run_all_tests.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "Running flake8" -flake_test=`flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics` +flake_test=`flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics` if [[ "${flake_test}" != 0 ]]; then echo "flake failed" exit diff --git a/ElliptiCBn/__init__.py b/src/ellipticbn/__init__.py similarity index 100% rename from ElliptiCBn/__init__.py rename to src/ellipticbn/__init__.py diff --git a/ElliptiCBn/__version__.py b/src/ellipticbn/__version__.py similarity index 100% rename from ElliptiCBn/__version__.py rename to src/ellipticbn/__version__.py diff --git a/ElliptiCBn/core.py b/src/ellipticbn/core.py similarity index 99% rename from ElliptiCBn/core.py rename to src/ellipticbn/core.py index 6dcf7dd..6a9133c 100644 --- a/ElliptiCBn/core.py +++ b/src/ellipticbn/core.py @@ -1,5 +1,5 @@ """ -Core functions to run ElliptiCBn. +Core functions to run ellipticbn. """ # dependencies @@ -421,7 +421,7 @@ def plot_results(atom_df, plot_cycles=True, pca_vector_list=None): """ - Plot structures resulting from an ElliptiCBn calculation. + Plot structures resulting from an ellipticbn calculation. Parameters ---------- diff --git a/ElliptiCBn/data/atom-colors.csv b/src/ellipticbn/data/atom-colors.csv similarity index 100% rename from ElliptiCBn/data/atom-colors.csv rename to src/ellipticbn/data/atom-colors.csv diff --git a/ElliptiCBn/data/palette-colors.txt b/src/ellipticbn/data/palette-colors.txt similarity index 100% rename from ElliptiCBn/data/palette-colors.txt rename to src/ellipticbn/data/palette-colors.txt diff --git a/ElliptiCBn/run_all.py b/src/ellipticbn/run_all.py similarity index 99% rename from ElliptiCBn/run_all.py rename to src/ellipticbn/run_all.py index 3b56367..eef11ce 100644 --- a/ElliptiCBn/run_all.py +++ b/src/ellipticbn/run_all.py @@ -185,7 +185,7 @@ def main_cli(argv=None,description=None): argv = sys.argv[1:] # Get program name - prog = "ElliptiCBn" + prog = "ellipticbn" # Get description if description is None: diff --git a/tests/conftest.py b/tests/ellipticbn/conftest.py similarity index 100% rename from tests/conftest.py rename to tests/ellipticbn/conftest.py diff --git a/tests/data/example-xyz/BATWAW.xyz b/tests/ellipticbn/data/example-xyz/BATWAW.xyz similarity index 100% rename from tests/data/example-xyz/BATWAW.xyz rename to tests/ellipticbn/data/example-xyz/BATWAW.xyz diff --git a/tests/data/example-xyz/GAFYIW.xyz b/tests/ellipticbn/data/example-xyz/GAFYIW.xyz similarity index 100% rename from tests/data/example-xyz/GAFYIW.xyz rename to tests/ellipticbn/data/example-xyz/GAFYIW.xyz diff --git a/tests/test_core.py b/tests/ellipticbn/test_core.py similarity index 95% rename from tests/test_core.py rename to tests/ellipticbn/test_core.py index bf69a59..285c9c9 100644 --- a/tests/test_core.py +++ b/tests/ellipticbn/test_core.py @@ -1,10 +1,10 @@ import pytest -from ElliptiCBn.core import _order_nodes -from ElliptiCBn.core import calc_ellipticity -from ElliptiCBn.core import get_macrocycles -from ElliptiCBn.core import get_ellipticity -from ElliptiCBn.core import plot_results +from ellipticbn.core import _order_nodes +from ellipticbn.core import calc_ellipticity +from ellipticbn.core import get_macrocycles +from ellipticbn.core import get_ellipticity +from ellipticbn.core import plot_results import numpy as np diff --git a/tests/test_run_all.py b/tests/ellipticbn/test_run_all.py similarity index 97% rename from tests/test_run_all.py rename to tests/ellipticbn/test_run_all.py index 2020394..e15b746 100644 --- a/tests/test_run_all.py +++ b/tests/ellipticbn/test_run_all.py @@ -1,7 +1,7 @@ import pytest -from ElliptiCBn.run_all import _file_check -from ElliptiCBn.run_all import run_all +from ellipticbn.run_all import _file_check +from ellipticbn.run_all import run_all import os diff --git a/tests/test_script.py b/tests/ellipticbn/test_script.py similarity index 87% rename from tests/test_script.py rename to tests/ellipticbn/test_script.py index 9402c9f..eb394f2 100644 --- a/tests/test_script.py +++ b/tests/ellipticbn/test_script.py @@ -3,7 +3,6 @@ import os import subprocess -import platform def test_script(example_xyz,tmpdir): @@ -11,13 +10,7 @@ def test_script(example_xyz,tmpdir): Basic test of the command line script. """ - # # Update test for windows - # if platform.system() == "Windows": - # here = os.path.abspath(os.path.dirname(__file__)) - # script = os.path.realpath(os.path.join(here,"..","bin","ElliptiCBn")) - # base_cmd = ["python",script] - # else: - base_cmd = ["ElliptiCBn"] + base_cmd = ["ellipticbn"] cwd = os.getcwd() os.chdir(tmpdir) From 09555ed543fe92f3c567596cc66b266dfdd498cb Mon Sep 17 00:00:00 2001 From: Michael Harms Date: Tue, 16 Jul 2024 13:56:17 -0700 Subject: [PATCH 21/21] somehow ipynb got moved to py --> fixed --- notebooks/{ellipticbn.py => ellipticbn.ipynb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename notebooks/{ellipticbn.py => ellipticbn.ipynb} (100%) diff --git a/notebooks/ellipticbn.py b/notebooks/ellipticbn.ipynb similarity index 100% rename from notebooks/ellipticbn.py rename to notebooks/ellipticbn.ipynb