-
Notifications
You must be signed in to change notification settings - Fork 17
updated build system and deprecated modules #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
c4730e1
053ee1c
029490d
021aa31
a4cd9fd
d256e97
e64382a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ polychrom/_polymer_math.cpp | |
| *.dat | ||
| .idea | ||
| dist | ||
| polychrom/*.so | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,19 @@ | ||
| __version__ = "0.1.1" | ||
|
|
||
| # Check for OpenMM installation | ||
| try: | ||
| import openmm | ||
| except ImportError: | ||
| import warnings | ||
| warnings.warn( | ||
| "\n" | ||
| "OpenMM is not installed. Polychrom requires OpenMM for molecular dynamics simulations.\n" | ||
| "\n" | ||
| "Please install OpenMM with the appropriate backend for your system:\n" | ||
| " - For CUDA: pip install openmm[cuda13]\n" | ||
| " - For CPU: pip install openmm\n" | ||
| "\n" | ||
| "Visit https://openmm.org for more information.", | ||
| ImportWarning, | ||
| stacklevel=2 | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ | |
| #include <cmath> | ||
| #include <vector> | ||
| #include <ctime> | ||
| #include <omp.h> | ||
|
|
||
| using namespace std; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ import sys | |
| import tempfile | ||
| import textwrap | ||
|
|
||
| import joblib | ||
| import numpy as np | ||
|
|
||
| usage = """ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from polychrom.polymerutils import * # noqa: F403 | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -24,33 +24,23 @@ | |||||
| xyz = data["pos"] | ||||||
| """ | ||||||
|
|
||||||
|
|
||||||
| from __future__ import absolute_import, division, print_function, unicode_literals | ||||||
|
|
||||||
| import glob | ||||||
| import io | ||||||
| import os | ||||||
| import warnings | ||||||
|
|
||||||
| import joblib | ||||||
| import numpy as np | ||||||
| import six | ||||||
|
|
||||||
| from polychrom.hdf5_format import load_URI | ||||||
|
|
||||||
| from . import hdf5_format | ||||||
|
|
||||||
|
|
||||||
| def load(filename): | ||||||
| """Universal load function for any type of data file It always returns just XYZ | ||||||
| positions - use fetch_block or hdf5_format.load_URI for loading the whole metadata | ||||||
|
|
||||||
| Accepted file types | ||||||
| ------------------- | ||||||
|
|
||||||
| New-style URIs (HDF5 based storage) | ||||||
|
|
||||||
| Text files in openmm-polymer format | ||||||
| joblib files in openmm-polymer format | ||||||
| """ | ||||||
| A function to load a single conformation from a URI. Deprecated. | ||||||
|
||||||
| A function to load a single conformation from a URI. Deprecated. | |
| A function to load a single conformation from a URI. Deprecated. |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deprecation warning should include a stacklevel parameter (typically stacklevel=2) to show the warning at the caller's location rather than within the deprecated function itself, making it more useful for users.
| warnings.warn("polymerutils.load is deprecated. Use hdf5_format.load_URI instead.", DeprecationWarning) | |
| warnings.warn("polymerutils.load is deprecated. Use hdf5_format.load_URI instead.", DeprecationWarning, stacklevel=2) |
mimakaev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deprecation warning should include a stacklevel parameter (typically stacklevel=2) to show the warning at the caller's location rather than within the deprecated function itself, making it more useful for users.
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing return statement when full_output=True for HDF5 files. When full_output=True, the function should return the full block dictionary but currently falls through without returning it. Add return block after line 115 or change line 115 to return block['pos'] and add an else: return block clause.
| return block |
mimakaev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,9 +1,59 @@ | ||||||
| [build-system] | ||||||
| requires = ["setuptools>=45", "wheel", "cython>=0.29", "numpy>=1.9"] | ||||||
| build-backend = "setuptools.build_meta" | ||||||
|
|
||||||
| [project] | ||||||
| name = "polychrom" | ||||||
| version = "0.1.1" | ||||||
| description = "A library for polymer simulations and their analyses." | ||||||
| readme = "README.md" | ||||||
| requires-python = ">=3.7" | ||||||
|
||||||
| requires-python = ">=3.7" | |
| requires-python = ">=3.13" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,6 @@ | ||
| six | ||
| cython | ||
| numpy>=1.9 | ||
| scipy>=0.16 | ||
| h5py>=2.5 | ||
| pandas>=0.19 | ||
| joblib | ||
| pyknotid | ||
| pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using wildcard imports (
import *) can make it unclear what symbols are being imported and can cause namespace pollution. Consider explicitly importing the specific functions or modules needed, or at minimum document what this legacy module is expected to provide.