Skip to content

Commit

Permalink
Merge pull request #10 from harmsm/main
Browse files Browse the repository at this point in the history
modernized build environment, unit testing
  • Loading branch information
harmsm authored Jul 16, 2024
2 parents 854eb6b + 09555ed commit 6f24386
Show file tree
Hide file tree
Showing 22 changed files with 218 additions and 214 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -14,21 +14,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
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
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: install ElliptiCBn
- name: install ellipticbn
run: |
# platform specific packages
python -m pip install . -vv -r requirements.txt
python -m pip install . pyproject.toml
- name: run flake8
run: |
Expand Down
3 changes: 0 additions & 3 deletions ElliptiCBn/__version__.py

This file was deleted.

8 changes: 3 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include requirements.txt
include ElliptiCBn/data/
include ElliptiCBn/data/*.csv
include ElliptiCBn/data/*.txt
include notebooks/*.ipynb
include src/ellipticbn/data/
include src/ellipticbn/data/*.csv
include src/ellipticbn/data/*.txt
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Run the program in the cloud without installing any software.

<a href="https://githubtocolab.com/harmslab/ElliptiCBn/blob/main/notebooks/ElliptiCBn.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<a href="https://githubtocolab.com/harmslab/ellipticbn/blob/main/notebooks/ellipticbn.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>



Expand Down Expand Up @@ -83,25 +83,25 @@ 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:**

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

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:
Expand All @@ -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:
Expand Down Expand Up @@ -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]
Expand Down
90 changes: 0 additions & 90 deletions bin/ElliptiCBn

This file was deleted.

14 changes: 7 additions & 7 deletions notebooks/ElliptiCBn.ipynb → notebooks/ellipticbn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -21,7 +21,7 @@
"\n",
"\n",
"\n",
"#### ElliptiCBn performs the following steps\n",
"#### ellipticbn performs the following steps\n",
"\n",
"<img src=\"https://github.com/harmsm/ElliptiC/raw/main/images/pipeline_image.png\" width=\"600px\"/>\n",
"\n",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
" %pip install . -r requirements.txt\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",
Expand Down
61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.distutils.bdist_wheel]
universal = true

[tool.setuptools.dynamic]
version = {attr = "ellipticbn.__version__.__version__"}

[tool.setuptools.package-data]
"*" = [
"src/ellipticbn/data/*.txt",
"src/ellipticbn/data/*.csv"
]

[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 = "[email protected]"},
{name = "Mike Harms", email = "[email protected]"},
]
maintainers = [
{name = "Mike Harms", email = "[email protected]"}
]
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"

[project.optional-dependencies]
test = [
"coverage",
"flake8",
"pytest"
]
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion run_all_tests.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
58 changes: 0 additions & 58 deletions setup.py

This file was deleted.

File renamed without changes.
3 changes: 3 additions & 0 deletions src/ellipticbn/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VERSION = (2, 1, 2)

__version__ = '.'.join(map(str, VERSION))
Loading

0 comments on commit 6f24386

Please sign in to comment.