Skip to content
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

Add test helpers #687

Open
wants to merge 5 commits into
base: protos
Choose a base branch
from
Open

Conversation

oerc0122
Copy link
Collaborator

@oerc0122 oerc0122 commented Feb 28, 2025

Description of work

  • Add test_helpers
    • Add paths test helper
    • Add compare_mdt to compare MDANSE trajectories.
    • Add get_deep_atr to extract attributes from nested objects.
  • Refactor test_converter, test_editor and the Analysis folders to use new routines as well as pytest.

Fixes
Fixes #676

To test
Standard tests.

@oerc0122 oerc0122 added enhancement New feature or request CI/CD Something concerning the CI/CD pipeline labels Feb 28, 2025
@oerc0122 oerc0122 self-assigned this Feb 28, 2025
@oerc0122 oerc0122 force-pushed the add-compare-mdt branch 2 times, most recently from 95471a1 to b6bbbc3 Compare March 3, 2025 13:50
@MBartkowiakSTFC
Copy link
Collaborator

Interestingly, on my computer I got two failing tests.

This was with rdkit-2024.3.3 and upgrading to rdkit-2024.9.5 solved the problem.

I don't think that we need to do enforce a specific version of rdkit. But maybe later we should investigate test_rdkit.py and decide if it really is useful.

For the record, the error was:

Tests/UnitTests/molecules/test_rdkit.py .EE.                                                                        [100%]

========================================================= ERRORS ==========================================================
______________________________________________ ERROR at setup of test_rdkit _______________________________________________

    @pytest.fixture()
    def mol_from_rdkit():
>       mol = MolFromPDBFile(fname)
E       Boost.Python.ArgumentError: Python argument types in
E           rdkit.Chem.rdmolfiles.MolFromPDBFile(PosixPath)
E       did not match C++ signature:
E           MolFromPDBFile(char const* molFileName, bool sanitize=True, bool removeHs=True, unsigned int flavor=0, bool proximityBonding=True)

Tests/UnitTests/molecules/test_rdkit.py:21: ArgumentError
____________________________________________ ERROR at setup of test_splitting _____________________________________________

    @pytest.fixture()
    def mol_from_rdkit():
>       mol = MolFromPDBFile(fname)
E       Boost.Python.ArgumentError: Python argument types in
E           rdkit.Chem.rdmolfiles.MolFromPDBFile(PosixPath)
E       did not match C++ signature:
E           MolFromPDBFile(char const* molFileName, bool sanitize=True, bool removeHs=True, unsigned int flavor=0, bool proximityBonding=True)

Tests/UnitTests/molecules/test_rdkit.py:21: ArgumentError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Something concerning the CI/CD pipeline enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test-global compare_mdt function.
2 participants