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

Fixing contamination_fraction in server mode #91

Merged
merged 7 commits into from
Feb 21, 2019
Merged

Fixing contamination_fraction in server mode #91

merged 7 commits into from
Feb 21, 2019

Conversation

Martin-Rey
Copy link

Hi,

This PR is a fix to issue #85 for which the contamination_fraction of haloes made of purely heavy particles would be 0.0 in server-mode.

This is bypassed by implementing a mass_resolution at the simulation level, similar to the spatial resolution already present. A quicker option from the snapshot size is also available if requested.

I also added two units tests on the Changa handler verifying that both the normal and quicker calculations return expected results. I further verified that the behaviour is the one expected from the documentation on three tests zoom simulation, both with and without the quicker flag.

Comments welcome!

Martin

@Martin-Rey
Copy link
Author

So the travis builds fails with bizarre errors that I cannot reproduce on my local setup. The source of the errors seems to be

Traceback (most recent call last):
  File "/home/travis/miniconda/envs/2.7_1.13.1/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromNameaddr.filename, addr.module)

  File "/home/travis/miniconda/envs/2.7_1.13.1/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)

  File "/home/travis/miniconda/envs/2.7_1.13.1/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)

  File "/home/travis/build/pynbody/tangos/tests/test_consistent_trees.py", line 2, in <module>
 import pynbody

  File "/home/travis/miniconda/envs/2.7_1.13.1/lib/python2.7/site-packages/pynbody/__init__.py", line 21, in <module> 
from . import util, filt, array, family, snapshot

  File "/home/travis/miniconda/envs/2.7_1.13.1/lib/python2.7/site-packages/pynbody/util.py", line 29, in <module>
    from ._util import *

  File "__init__.pxd", line 918, in init pynbody._util
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject 

I suspected it was due to the new version release of CYTHON (Jan 19th) but I can't reproduce this issue at all. Any ideas?

@Martin-Rey
Copy link
Author

Update: this building/compilation error from pynbody was also reported here (pynbody/pynbody#503) and seems to originate from incompatible numpy/scipy interactions.

Any preferred directions to fix this?

@Martin-Rey
Copy link
Author

Thanks for the comments! They should be addressed in the last commit.

@apontzen apontzen merged commit decab8c into pynbody:master Feb 21, 2019
@Martin-Rey Martin-Rey deleted the inconsistent-contamination branch February 21, 2019 10:44
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

Successfully merging this pull request may close these issues.

2 participants