Skip to content

Conversation

@jngrad
Copy link
Member

@jngrad jngrad commented May 30, 2025

Fixes #13

Description of changes:

  • parameter files and the lib/ folder now belong to the pyMBE package
  • all other files (samples, tutorials, maintainer scripts, paper scripts, etc.) still belong to the pyMBE project, but they don't get deployed when installing the pyMBE package
  • function pmb.get_resource() was removed

@jngrad
Copy link
Member Author

jngrad commented May 30, 2025

Note: pdoc automatically creates an empty landing page for package modules. Comment lines were added in the readme file to populate the landing page with something useful. Here is a preview of the new documentation:
https://jngrad.github.io/pyMBE/pyMBE.html

You can test packaging locally by creating a new file setup.py at the top-level of your git clone and populating it with:

from setuptools import find_packages, setup

with open("README.md", "r") as f:
    long_description = f.read()

with open("requirements.txt") as f:
    required = f.read().splitlines()

setup(
    name="pyMBE",
    version="0.8.0",
    author="David Beyer, Pablo M. Blanco, et al.",
    author_email="pablb@ntnu.no",
    description="Toolkit to facilitate building up molecules with complex architectures in the molecular dynamics software ESPResSo.",
    long_description=long_description,
    long_description_content_type="text/markdown",
    packages=find_packages(),
    python_requires=">=3.10",
    install_requires=required,
)

Then install pyMBE in a fresh virtual environment with:

python3 -m venv venv-local
source venv-local/bin/activate
python3 maintainer/configure_venv.py --espresso_path=/home/jgrad/espresso/build # adapt path
pip install .  # install pyMBE and its dependencies automatically
cd testsuite   # important: leave the current folder! otherwise Python imports the local pyMBE folder
python3 bond_tests.py

Please note setup.py is deprecated in favor of toml files. For more details, see this chapter in the pip documentation. The example above is only meant as a sanity check. Packaging pyMBE on PyPI is not within the scope of this PR.

@jngrad jngrad added this to the pyMBE 1.0.0 milestone May 30, 2025
@pm-blanco pm-blanco self-requested a review June 4, 2025 10:30
@pm-blanco pm-blanco added enhancement New feature or request code quality labels Jun 4, 2025
Copy link
Collaborator

@pm-blanco pm-blanco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you @jngrad for your thorough work in restructuring pyMBE and for keeping our coding standards to level!

@pm-blanco pm-blanco merged commit ed7a6e3 into pyMBE-dev:main Jun 6, 2025
3 checks passed
@jngrad jngrad deleted the package branch June 6, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert pyMBE into a package

2 participants