Skip to content

Conversation

Copy link

Copilot AI commented Jan 5, 2026

Renames the constrained_anm module to generalized_anm throughout the codebase to reflect the module's generalized nature rather than its constrained implementation details.

⚠️ Breaking Change: This PR removes all backward compatibility. Existing code using the old names will break and must be updated.

Changes

Module and identifier renaming

  • prody/dynamics/constrained_anm.pyprody/dynamics/generalized_anm.py
  • prody/tests/dynamics/test_constrained_anm.pyprody/tests/dynamics/test_generalized_anm.py
  • Class: cANMgenANM
  • Function: calcCANMcalcGenANM
  • Internal: build_constrained_hessianbuild_generalized_hessian
  • Updated docstrings and comments

calcENM integration

  • Added support for new model names: 'genANM', 'generalized', 'generalized_anm'
  • Old names ('canm', 'constrained', 'constrained_anm') are no longer supported

No backward compatibility

  • The old constrained_anm module no longer exists
  • Importing from prody.dynamics.constrained_anm will raise ImportError
  • Using old model names in calcENM() will raise TypeError

Usage

# New API (only supported way)
from prody.dynamics import genANM, calcGenANM
model = calcENM(atoms, model='genANM', n_modes=10)

# Old API - NO LONGER WORKS
# from prody.dynamics import cANM, calcCANM  # ImportError
# model = calcENM(atoms, model='canm', n_modes=10)  # TypeError

Migration Required

Users must update their code:

  • Change imports: from prody.dynamics.constrained_anm import cANMfrom prody.dynamics.generalized_anm import genANM
  • Rename class: cANMgenANM
  • Rename function: calcCANMcalcGenANM
  • Update model names: 'canm''genANM' (or 'generalized', 'generalized_anm')
Original prompt

Rename module and symbol names for generalized ANM

Summary:
The new module originally named "constrained_anm" (short name "canm") should be renamed to "generalized_anm" with short name "genANM" across the entire codebase. The PR should perform a repository-wide, case-aware rename and update all references, filenames, imports, docs, tests, examples, and packaging metadata so the project builds and tests pass (where possible). Do not change behavior except for the identifier/name changes.

Required changes (detailed and actionable):

  1. Filenames and packages
  • Rename any file or directory named exactly constrained_anm.py, constrained_anm/, or similar to generalized_anm.py, generalized_anm/ respectively.
  • If there are compiled or generated artifacts related to the module (build artifacts, .so/.pyd files, or generated docs referencing old filename), update references but do not include binary artifacts in the PR.
  1. Python imports and code references
  • Replace occurrences of the identifier constrained_anm (all-lowercase) with generalized_anm.
  • Replace occurrences of the short identifier canm (lowercase) with genANM (exact case). Note: do a case-sensitive replacement for canm -> genANM.
  • Replace CANM -> GENANM (for all-uppercase constants or macros).
  • Replace ConstrainedANM (CamelCase class name) -> GeneralizedANM (preserve CamelCase class convention). Also handle ConstrainedAnm -> GeneralizedAnm if present.
  • Update any __all__ exports, package __init__.py imports, and from prody.constrained_anm import ... to from prody.generalized_anm import ... or equivalent.
  • Update unit tests, examples, docstrings, and notebooks that import or refer to the old names.
  1. Documentation
  • Update Sphinx/reStructuredText/Markdown docs to use generalized_anm and genANM where they previously used the old names.
  • Update any links, cross-references, or API docs that mention constrained_anm/canm.
  1. Packaging and metadata
  • Update setup/config files if they reference the old module name (e.g., entry points, package_data, MANIFEST.in, docs config).
  1. Tests
  • Update tests to import and use the new names. If feasible, run the test suite and fix any remaining references. If running tests isn't possible in the PR environment, at minimum ensure imports are updated so tests will reference the new module name.
  1. Backwards compatibility (optional but recommended)
  • Where safe, add a lightweight compatibility shim so prody.constrained_anm and canm remain importable for a deprecation cycle. For example, create a constrained_anm.py that imports and re-exports symbols from generalized_anm and issues a DeprecationWarning on import. Include the shim only if it keeps the codebase consistent and doesn't introduce circular imports.
  1. References in metadata, changelogs, and examples
  • Update README, changelog, examples, and any CI workflow files that reference the old names.
  1. Search scope
  • Search the entire repository (all directories) for occurrences of the tokens listed above and update them. Be careful to only change identifiers and not unrelated words that contain the substring (for example, avoid changing words like canmesh if present). Prefer token/boundary-aware replacements (identifiers, import paths, class/function/variable names) rather than blind substring replace.

Deliverables in the PR:

  • A branch with the rename changes and updated files.
  • If created, a small compatibility shim file constrained_anm.py that re-exports from generalized_anm and raises a DeprecationWarning (make this change only if it doesn't create circular import problems).
  • A clear PR description explaining what was renamed, why, and any backward-compatibility measures added.
  • A short checklist in the PR description of files/areas updated (modules, docs, tests, CI, packaging).

Notes and constraints:

  • Do not alter logic beyond renaming tokens and updating imports/docs.
  • Preserve code formatting and style as much as possible.
  • If ambiguous cases are found (uncertain capitalization or intended meaning), prefer conservative edits and add a TODO comment in the changed file noting the ambiguity for maintainers to review.

Please create a pull request in the prody/ProDy repository that implements the above changes.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 5, 2026 21:13
Co-authored-by: AnthonyBogetti <34397256+AnthonyBogetti@users.noreply.github.com>
Co-authored-by: AnthonyBogetti <34397256+AnthonyBogetti@users.noreply.github.com>
Co-authored-by: AnthonyBogetti <34397256+AnthonyBogetti@users.noreply.github.com>
Co-authored-by: AnthonyBogetti <34397256+AnthonyBogetti@users.noreply.github.com>
Copilot AI changed the title [WIP] Rename constrained_anm module to generalized_anm Rename constrained_anm module to generalized_anm Jan 5, 2026
Copilot AI requested a review from AnthonyBogetti January 5, 2026 21:24
@AnthonyBogetti
Copy link
Member

@copilot I DO NOT want Backward compatibility shim for constrained_anm module.

Co-authored-by: AnthonyBogetti <34397256+AnthonyBogetti@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 5, 2026

@copilot I DO NOT want Backward compatibility shim for constrained_anm module.

Removed the backward compatibility shim. The old constrained_anm module and old model names (canm, constrained, constrained_anm) are no longer supported. Users must now use the new names (genANM, generalized, generalized_anm). Commit: ccb4a08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants