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

Test failure on TestCluster.test_cluster_props_advanced_weighted unexpected keyword arg #1011

Open
marmolRBG opened this issue Sep 17, 2022 · 2 comments

Comments

@marmolRBG
Copy link

Hello,

I attempted to run the tests and am getting an error that's related to an unexpected argument within the freud source code that's being passed - 'masses'

Thanks for any help

`============================================================================================ test session starts =============================================================================================
platform darwin -- Python 3.8.5, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: /Users/pauljohnson/project/MD/freud, configfile: setup.cfg
collected 794 items

test_box_Box.py ...................................................... [ 6%]
test_cluster.py ...F..... [ 7%]
test_data.py .................................. [ 12%]
test_density_CorrelationFunction.py .......s.......... [ 14%]
test_density_GaussianDensity.py ................. [ 16%]
test_density_LocalDensity.py ...... [ 17%]
test_density_RDF.py ................. [ 19%]
test_density_SphereVoxelization.py ..... [ 20%]
test_diffraction_DiffractionPattern.py ............................................................................................ [ 31%]
test_diffraction_StaticStructureFactor.py ...................................................................................s..s..s..s...... [ 44%]
test_doctests.py ........................... [ 47%]
test_environment_AngularSeparation.py ....... [ 48%]
test_environment_BondOrder.py .... [ 48%]
test_environment_LocalBondProjection.py .... [ 49%]
test_environment_LocalDescriptors.py .................. [ 51%]
test_environment_MatchEnv.py ............ [ 53%]
test_interface.py .... [ 53%]
test_locality_NeighborList.py ................. [ 55%]
test_locality_NeighborQuery.py .................................................................................................................................. [ 72%]
test_locality_PeriodicBuffer.py ....... [ 73%]
test_locality_Voronoi.py ........... [ 74%]
test_msd_MSD.py ... [ 74%]
test_order_Cubatic.py .... [ 75%]
test_order_Hexatic.py ................................... [ 79%]
test_order_Nematic.py ... [ 80%]
test_order_RotationalAutocorrelation.py ................... [ 82%]
test_order_SolidLiquid.py ......... [ 83%]
test_order_Steinhardt.py .................................................... [ 90%]
test_order_Translational.py .. [ 90%]
test_parallel.py .. [ 90%]
test_pmft.py ................................................ [ 96%]
test_util.py ....... [ 97%]
integration/test_reader_integrations.py ss...s [ 98%]
validation/test_Minkowski_Structure_Metrics.py .... [ 98%]
validation/test_Steinhardt_Average.py ........ [100%]

================================================================================================== FAILURES ===================================================================================================
______________________________________________________________________________ TestCluster.test_cluster_props_advanced_weighted _______________________________________________________________________________

self = <test_cluster.TestCluster object at 0x7fb0024fc790>

def test_cluster_props_advanced_weighted(self):
    """Tests radius of gyration, center of mass and inertia tensor calculations."""
    box = freud.box.Box.square(L=5)
    positions = np.array([[0, -2, 0], [0, -2, 0], [0, 2, 0], [-0.1, 1.9, 0]])
    masses = np.array([1, 2, 3, 4])
    clust = freud.cluster.Cluster()
    clust.compute((box, positions), neighbors={"r_max": 0.5})

    props = freud.cluster.ClusterProperties()
  props.compute((box, positions), clust.cluster_idx, masses=masses)

test_cluster.py:108:


util.pyx:165: in freud.util._Compute.getattribute.compute_wrapper
???


???
E TypeError: compute() got an unexpected keyword argument 'masses'

cluster.pyx:183: TypeError
============================================================================================== warnings summary ===============================================================================================
../../../../opt/anaconda3/lib/python3.8/site-packages/matplotlib/init.py:169
../../../../opt/anaconda3/lib/python3.8/site-packages/matplotlib/init.py:169
../../../../opt/anaconda3/lib/python3.8/site-packages/matplotlib/init.py:169
../../../../opt/anaconda3/lib/python3.8/site-packages/matplotlib/init.py:169
../../../../opt/anaconda3/lib/python3.8/site-packages/matplotlib/init.py:169
/Users/pauljohnson/opt/anaconda3/lib/python3.8/site-packages/matplotlib/init.py:169: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(module.version) < minver:

../../../../opt/anaconda3/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../../opt/anaconda3/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../../opt/anaconda3/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../../opt/anaconda3/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../../opt/anaconda3/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
/Users/pauljohnson/opt/anaconda3/lib/python3.8/site-packages/setuptools/_distutils/version.py:351: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
other = LooseVersion(other)

tests/integration/test_reader_integrations.py: 10 warnings
tests/validation/test_Minkowski_Structure_Metrics.py: 4 warnings
/Users/pauljohnson/opt/anaconda3/lib/python3.8/site-packages/gsd/hoomd.py:852: DeprecationWarning: Deprecated, trajectory[idx]
warnings.warn("Deprecated, trajectory[idx]", DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================================================================================== short test summary info ===========================================================================================
FAILED test_cluster.py::TestCluster::test_cluster_props_advanced_weighted - TypeError: compute() got an unexpected keyword argument 'masses'
=========================================================================== 1 failed, 785 passed, 8 skipped, 24 warnings in 58.33s ============================================================================`

@bdice
Copy link
Member

bdice commented Sep 17, 2022

@marmolRBG Thanks for reporting this issue. It looks like you might be running tests from the current version of the repository after #988 was merged, but the version of freud you're using to run the tests might not be new enough to include those changes. You might need to pull the repository again and rebuild the package from source, or wait until the changes in #988 are released.

@tommy-waltmann
Copy link
Collaborator

The explanation from @bdice for this behavior sounds reasonable. If this doesn't explain what is going on, please indicate what version of freud is installed on the system, where it was installed from, and what version of the tests are being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants