co2-potential 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.1
2
+ Name: co2_potential
3
+ Version: 0.1.0
4
+ Summary: A Python package interfacing with the CO2CO2 shared library.
5
+ Author: Olaseni Sode
6
+ Author-email: osode@calstatela.edu
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: MacOS :: MacOS X
10
+ Requires-Python: >=3.6
11
+ Description-Content-Type: text/markdown
12
+
13
+ # Molecule Potential Energy Library
14
+
15
+ This project provides a high-performance C++ library for calculating the potential energy of a CO₂ molecular system. The C++ routines are exposed to Python via both a ctypes-based wrapper and a (optional) pybind11 module, allowing you to leverage the speed of C++ with the ease-of-use of Python.
16
+
17
+ ## Project Structure
18
+
19
+ ```
20
+ molecule-potential/ # Root directory
21
+ ├── src/ # C++ source files
22
+ │ ├── mbCO2CO2.cpp # Implements the energy routines and exports functions
23
+ │ ├── mbCO2CO2.h # Declarations for the energy routine functions:
24
+ │ │ // double p1b(double* xyz);
25
+ │ │ // double p2b(double* xyz);
26
+ │ │ // double sapt(double* xyz);
27
+ │ └── ... (other files)
28
+ ├── python/ # (Optional) pybind11 C++ binding module source
29
+ │ └── module.cpp # Implements a Python module using pybind11
30
+ ├── wrapper.py # Python wrapper using ctypes to load the shared library
31
+ ├── CMakeLists.txt # CMake configuration to build the shared libraries
32
+ ├── setup.py # Setup script for building and packaging the project for PyPI
33
+ ├── README.md # This file
34
+ └── LICENSE # License file (e.g., MIT License)
35
+ ```
36
+
37
+ ## Installation
38
+
39
+ ### Prerequisites
40
+
41
+ - A C++ compiler and [CMake](https://cmake.org/) (version 3.10 or above)
42
+ - [Python 3.6+](https://www.python.org/) with pip
43
+
44
+ ### Build the C++ Shared Library
45
+
46
+ This project uses CMake to build two targets:
47
+ - **potential_energy**: The core shared library built from all C++ source files in the `src/` directory.
48
+ - **molecule_module**: A Python module (using pybind11) that links against `potential_energy` (optional if you prefer the ctypes wrapper).
49
+
50
+ To build the shared library:
51
+
52
+ 1. Open a terminal in the project root and create a build directory:
53
+
54
+ ```bash
55
+ mkdir build
56
+ cd build
57
+ ```
58
+
59
+ 2. Run CMake and build:
60
+
61
+ ```bash
62
+ cmake ..
63
+ make
64
+ ```
65
+
66
+ The `molecule_module` shared library will be placed in `build/python` as defined in the `CMakeLists.txt`. The core shared library built from your `src/` files will be named (for example) `libCO2CO2.so`.
67
+
68
+ ### Install the Package
69
+
70
+ The project can be installed as a Python package using pip. The provided `setup.py` script calls a custom build command to build the C++ shared library before packaging.
71
+
72
+ From the project root, run:
73
+
74
+ ```bash
75
+ pip install .
76
+ ```
77
+
78
+ This process will:
79
+ - Build the C++ shared library (via CMake or Makefile as configured).
80
+ - Package the Python wrapper (and optionally the pybind11 module) along with the shared library so that they can be imported in Python.
81
+
82
+ ## Usage
83
+
84
+ You can access the energy routines through the `wrapper.py` interface (which uses ctypes to load the shared library). For example:
85
+
86
+ ```python
87
+ from wrapper import p1b, p2b, sapt
88
+
89
+ # Example coordinates for 6 atoms (each atom has 3 coordinates);
90
+ # adjust these values as required by your application:
91
+ xyz = [
92
+ 0.0, 0.0, 0.000, # Atom 1 (C)
93
+ 0.0, 0.0, -1.162, # Atom 2 (O)
94
+ 0.0, 0.0, 1.162, # Atom 3 (O)
95
+ 7.0, 0.0, 0.000, # Atom 4 (C)
96
+ 7.0, 0.0, -1.162, # Atom 5 (O)
97
+ 7.0, 0.0, 1.162 # Atom 6 (O)
98
+ ]
99
+
100
+ energy_p1 = p1b(xyz)
101
+ energy_p2 = p2b(xyz)
102
+ energy_sapt = sapt(xyz)
103
+
104
+ print("Energy from p1b:", energy_p1)
105
+ print("Energy from p2b:", energy_p2)
106
+ print("Energy from sapt:", energy_sapt)
107
+ ```
108
+
109
+ > **Note:** If you built the pybind11 module (from `python/module.cpp`), you can alternatively import the module (e.g., `import co2_potential`) and call its functions (provided they are bound similarly to the ctypes wrappers).
110
+
111
+ ## Functionality
112
+
113
+ The library calculates the potential energy of a CO₂ system using multiple routines:
114
+
115
+ - **p1b:** Computes a portion of the potential energy (using routines from `x1b`).
116
+ - **p2b:** Computes another portion of the potential energy (using routines from `x2b`).
117
+ - **sapt:** Calculates energy contributions based on SAPT (Symmetry-Adapted Perturbation Theory) components.
118
+
119
+ The core computations are implemented in C++ for performance.
120
+
121
+ ## Contributing
122
+
123
+ Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
124
+
125
+ ## License
126
+
127
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,115 @@
1
+ # Molecule Potential Energy Library
2
+
3
+ This project provides a high-performance C++ library for calculating the potential energy of a CO₂ molecular system. The C++ routines are exposed to Python via both a ctypes-based wrapper and a (optional) pybind11 module, allowing you to leverage the speed of C++ with the ease-of-use of Python.
4
+
5
+ ## Project Structure
6
+
7
+ ```
8
+ molecule-potential/ # Root directory
9
+ ├── src/ # C++ source files
10
+ │ ├── mbCO2CO2.cpp # Implements the energy routines and exports functions
11
+ │ ├── mbCO2CO2.h # Declarations for the energy routine functions:
12
+ │ │ // double p1b(double* xyz);
13
+ │ │ // double p2b(double* xyz);
14
+ │ │ // double sapt(double* xyz);
15
+ │ └── ... (other files)
16
+ ├── python/ # (Optional) pybind11 C++ binding module source
17
+ │ └── module.cpp # Implements a Python module using pybind11
18
+ ├── wrapper.py # Python wrapper using ctypes to load the shared library
19
+ ├── CMakeLists.txt # CMake configuration to build the shared libraries
20
+ ├── setup.py # Setup script for building and packaging the project for PyPI
21
+ ├── README.md # This file
22
+ └── LICENSE # License file (e.g., MIT License)
23
+ ```
24
+
25
+ ## Installation
26
+
27
+ ### Prerequisites
28
+
29
+ - A C++ compiler and [CMake](https://cmake.org/) (version 3.10 or above)
30
+ - [Python 3.6+](https://www.python.org/) with pip
31
+
32
+ ### Build the C++ Shared Library
33
+
34
+ This project uses CMake to build two targets:
35
+ - **potential_energy**: The core shared library built from all C++ source files in the `src/` directory.
36
+ - **molecule_module**: A Python module (using pybind11) that links against `potential_energy` (optional if you prefer the ctypes wrapper).
37
+
38
+ To build the shared library:
39
+
40
+ 1. Open a terminal in the project root and create a build directory:
41
+
42
+ ```bash
43
+ mkdir build
44
+ cd build
45
+ ```
46
+
47
+ 2. Run CMake and build:
48
+
49
+ ```bash
50
+ cmake ..
51
+ make
52
+ ```
53
+
54
+ The `molecule_module` shared library will be placed in `build/python` as defined in the `CMakeLists.txt`. The core shared library built from your `src/` files will be named (for example) `libCO2CO2.so`.
55
+
56
+ ### Install the Package
57
+
58
+ The project can be installed as a Python package using pip. The provided `setup.py` script calls a custom build command to build the C++ shared library before packaging.
59
+
60
+ From the project root, run:
61
+
62
+ ```bash
63
+ pip install .
64
+ ```
65
+
66
+ This process will:
67
+ - Build the C++ shared library (via CMake or Makefile as configured).
68
+ - Package the Python wrapper (and optionally the pybind11 module) along with the shared library so that they can be imported in Python.
69
+
70
+ ## Usage
71
+
72
+ You can access the energy routines through the `wrapper.py` interface (which uses ctypes to load the shared library). For example:
73
+
74
+ ```python
75
+ from wrapper import p1b, p2b, sapt
76
+
77
+ # Example coordinates for 6 atoms (each atom has 3 coordinates);
78
+ # adjust these values as required by your application:
79
+ xyz = [
80
+ 0.0, 0.0, 0.000, # Atom 1 (C)
81
+ 0.0, 0.0, -1.162, # Atom 2 (O)
82
+ 0.0, 0.0, 1.162, # Atom 3 (O)
83
+ 7.0, 0.0, 0.000, # Atom 4 (C)
84
+ 7.0, 0.0, -1.162, # Atom 5 (O)
85
+ 7.0, 0.0, 1.162 # Atom 6 (O)
86
+ ]
87
+
88
+ energy_p1 = p1b(xyz)
89
+ energy_p2 = p2b(xyz)
90
+ energy_sapt = sapt(xyz)
91
+
92
+ print("Energy from p1b:", energy_p1)
93
+ print("Energy from p2b:", energy_p2)
94
+ print("Energy from sapt:", energy_sapt)
95
+ ```
96
+
97
+ > **Note:** If you built the pybind11 module (from `python/module.cpp`), you can alternatively import the module (e.g., `import co2_potential`) and call its functions (provided they are bound similarly to the ctypes wrappers).
98
+
99
+ ## Functionality
100
+
101
+ The library calculates the potential energy of a CO₂ system using multiple routines:
102
+
103
+ - **p1b:** Computes a portion of the potential energy (using routines from `x1b`).
104
+ - **p2b:** Computes another portion of the potential energy (using routines from `x2b`).
105
+ - **sapt:** Calculates energy contributions based on SAPT (Symmetry-Adapted Perturbation Theory) components.
106
+
107
+ The core computations are implemented in C++ for performance.
108
+
109
+ ## Contributing
110
+
111
+ Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
112
+
113
+ ## License
114
+
115
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.1
2
+ Name: co2_potential
3
+ Version: 0.1.0
4
+ Summary: A Python package interfacing with the CO2CO2 shared library.
5
+ Author: Olaseni Sode
6
+ Author-email: osode@calstatela.edu
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: MacOS :: MacOS X
10
+ Requires-Python: >=3.6
11
+ Description-Content-Type: text/markdown
12
+
13
+ # Molecule Potential Energy Library
14
+
15
+ This project provides a high-performance C++ library for calculating the potential energy of a CO₂ molecular system. The C++ routines are exposed to Python via both a ctypes-based wrapper and a (optional) pybind11 module, allowing you to leverage the speed of C++ with the ease-of-use of Python.
16
+
17
+ ## Project Structure
18
+
19
+ ```
20
+ molecule-potential/ # Root directory
21
+ ├── src/ # C++ source files
22
+ │ ├── mbCO2CO2.cpp # Implements the energy routines and exports functions
23
+ │ ├── mbCO2CO2.h # Declarations for the energy routine functions:
24
+ │ │ // double p1b(double* xyz);
25
+ │ │ // double p2b(double* xyz);
26
+ │ │ // double sapt(double* xyz);
27
+ │ └── ... (other files)
28
+ ├── python/ # (Optional) pybind11 C++ binding module source
29
+ │ └── module.cpp # Implements a Python module using pybind11
30
+ ├── wrapper.py # Python wrapper using ctypes to load the shared library
31
+ ├── CMakeLists.txt # CMake configuration to build the shared libraries
32
+ ├── setup.py # Setup script for building and packaging the project for PyPI
33
+ ├── README.md # This file
34
+ └── LICENSE # License file (e.g., MIT License)
35
+ ```
36
+
37
+ ## Installation
38
+
39
+ ### Prerequisites
40
+
41
+ - A C++ compiler and [CMake](https://cmake.org/) (version 3.10 or above)
42
+ - [Python 3.6+](https://www.python.org/) with pip
43
+
44
+ ### Build the C++ Shared Library
45
+
46
+ This project uses CMake to build two targets:
47
+ - **potential_energy**: The core shared library built from all C++ source files in the `src/` directory.
48
+ - **molecule_module**: A Python module (using pybind11) that links against `potential_energy` (optional if you prefer the ctypes wrapper).
49
+
50
+ To build the shared library:
51
+
52
+ 1. Open a terminal in the project root and create a build directory:
53
+
54
+ ```bash
55
+ mkdir build
56
+ cd build
57
+ ```
58
+
59
+ 2. Run CMake and build:
60
+
61
+ ```bash
62
+ cmake ..
63
+ make
64
+ ```
65
+
66
+ The `molecule_module` shared library will be placed in `build/python` as defined in the `CMakeLists.txt`. The core shared library built from your `src/` files will be named (for example) `libCO2CO2.so`.
67
+
68
+ ### Install the Package
69
+
70
+ The project can be installed as a Python package using pip. The provided `setup.py` script calls a custom build command to build the C++ shared library before packaging.
71
+
72
+ From the project root, run:
73
+
74
+ ```bash
75
+ pip install .
76
+ ```
77
+
78
+ This process will:
79
+ - Build the C++ shared library (via CMake or Makefile as configured).
80
+ - Package the Python wrapper (and optionally the pybind11 module) along with the shared library so that they can be imported in Python.
81
+
82
+ ## Usage
83
+
84
+ You can access the energy routines through the `wrapper.py` interface (which uses ctypes to load the shared library). For example:
85
+
86
+ ```python
87
+ from wrapper import p1b, p2b, sapt
88
+
89
+ # Example coordinates for 6 atoms (each atom has 3 coordinates);
90
+ # adjust these values as required by your application:
91
+ xyz = [
92
+ 0.0, 0.0, 0.000, # Atom 1 (C)
93
+ 0.0, 0.0, -1.162, # Atom 2 (O)
94
+ 0.0, 0.0, 1.162, # Atom 3 (O)
95
+ 7.0, 0.0, 0.000, # Atom 4 (C)
96
+ 7.0, 0.0, -1.162, # Atom 5 (O)
97
+ 7.0, 0.0, 1.162 # Atom 6 (O)
98
+ ]
99
+
100
+ energy_p1 = p1b(xyz)
101
+ energy_p2 = p2b(xyz)
102
+ energy_sapt = sapt(xyz)
103
+
104
+ print("Energy from p1b:", energy_p1)
105
+ print("Energy from p2b:", energy_p2)
106
+ print("Energy from sapt:", energy_sapt)
107
+ ```
108
+
109
+ > **Note:** If you built the pybind11 module (from `python/module.cpp`), you can alternatively import the module (e.g., `import co2_potential`) and call its functions (provided they are bound similarly to the ctypes wrappers).
110
+
111
+ ## Functionality
112
+
113
+ The library calculates the potential energy of a CO₂ system using multiple routines:
114
+
115
+ - **p1b:** Computes a portion of the potential energy (using routines from `x1b`).
116
+ - **p2b:** Computes another portion of the potential energy (using routines from `x2b`).
117
+ - **sapt:** Calculates energy contributions based on SAPT (Symmetry-Adapted Perturbation Theory) components.
118
+
119
+ The core computations are implemented in C++ for performance.
120
+
121
+ ## Contributing
122
+
123
+ Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
124
+
125
+ ## License
126
+
127
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,6 @@
1
+ README.md
2
+ setup.py
3
+ co2_potential.egg-info/PKG-INFO
4
+ co2_potential.egg-info/SOURCES.txt
5
+ co2_potential.egg-info/dependency_links.txt
6
+ co2_potential.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,48 @@
1
+ import os
2
+ import subprocess
3
+ from setuptools import setup, find_packages, Command
4
+
5
+ class MakeBuild(Command):
6
+ description = "Build the C++ shared library using Makefile"
7
+ user_options = []
8
+
9
+ def initialize_options(self):
10
+ pass
11
+
12
+ def finalize_options(self):
13
+ pass
14
+
15
+ def run(self):
16
+ # Run make in the src directory.
17
+ cwd = os.path.join(os.path.dirname(__file__), "src")
18
+ subprocess.check_call(["make", "clean"], cwd=cwd)
19
+ subprocess.check_call(["make"], cwd=cwd)
20
+
21
+ # Read the README for the long description.
22
+ with open("README.md", "r", encoding="utf-8") as fh:
23
+ long_description = fh.read()
24
+
25
+ setup(
26
+ name="co2_potential",
27
+ version="0.1.0",
28
+ author="Olaseni Sode",
29
+ author_email="osode@calstatela.edu",
30
+ description="A Python package interfacing with the CO2CO2 shared library.",
31
+ long_description=long_description,
32
+ long_description_content_type="text/markdown",
33
+ packages=find_packages(),
34
+ include_package_data=True,
35
+ package_data={
36
+ # Include the shared library from the src folder.
37
+ "libCO2CO2": ["../src/libCO2CO2.so"],
38
+ },
39
+ cmdclass={
40
+ "build_ext": MakeBuild, # Runs the MakeBuild command before build_ext.
41
+ },
42
+ classifiers=[
43
+ "Programming Language :: Python :: 3",
44
+ "License :: OSI Approved :: MIT License",
45
+ "Operating System :: MacOS :: MacOS X",
46
+ ],
47
+ python_requires=">=3.6",
48
+ )