diff --git a/.travis.yml. b/.travis.yml. deleted file mode 100644 index 2cd29d8..0000000 --- a/.travis.yml. +++ /dev/null @@ -1,61 +0,0 @@ -language: python - -branches: - except: - - dev - - extended_datafiles - - -env: - global: - - CC_TEST_REPORTER_ID=bdc5010b5f2e62769ccd2d885f0d7eb59691844de9a2018e9e3da255a37282e2 - -matrix: - include: - - - os: linux - sudo: required - python: 3.6 - env: MDAv=1.0.0 - - # - os: osx - # language: generic - # env: MDAv=0.16 - - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then - brew update; - curl -s --location "https://bootstrap.pypa.io/get-pip.py" -o get-pip.py ; - python get-pip.py --user ; - alias pip='pip2' - pip install --upgrade pip ; - fi -# - if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then sudo apt-get install liblapack-dev -y ; fi - -install: -- pip install codecov -- pip install pylama -- pip install pytest-cov -- pip install Sphinx>=1.4.3 -- pip install matplotlib -- pip install cython -- pip install MDAnalysis==$MDAv -- pip install pandas -- pip install mdtraj -- pip install nose -- pip install . -# command to run tests - -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - -script: python setup.py test - - -after_script: - if ([ "$TRAVIS_OS_NAME" == "linux" ] && [ "$MDAv" == "0.19" ]) ; then - pip install codecov; pip install pytest-cov ; py.test --cov=pytim pytim/*py pytim/observables/*py pytim/datafiles/*py --doctest-modules --cov-report xml ; ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT ; codecov ; fi - diff --git a/pytim/willard_chandler.py b/pytim/willard_chandler.py index 9f433db..1961dab 100644 --- a/pytim/willard_chandler.py +++ b/pytim/willard_chandler.py @@ -39,6 +39,9 @@ class WillardChandler(Interface): this group :param float alpha: The width of the Gaussian kernel :param float mesh: The grid spacing for the density calculation + :param float density_cutoff: The density value used to define the + isosurface. `None` (default) uses the average + of the minimum and maximum density. :param AtomGroup group: Compute the density using this group :param dict radii_dict: Dictionary with the atomic radii of the elements in the group. @@ -127,10 +130,12 @@ def __init__(self, centered=False, warnings=False, autoassign=True, + density_cutoff=None, **kargs): self.autoassign, self.do_center = autoassign, centered self.include_zero_radius = include_zero_radius + self.density_cutoff = density_cutoff sanity = SanityCheck(self, warnings=warnings) sanity.assign_universe(universe, group) sanity.assign_alpha(alpha) @@ -245,7 +250,7 @@ def _assign_layers(self): volume = self.density_field.reshape( tuple(np.array(ngrid[::-1]).astype(int))) verts, faces, normals, values = marching_cubes( - volume, None, spacing=tuple(spacing)) + volume, self.density_cutoff, spacing=tuple(spacing)) # note that len(normals) == len(verts): they are normals # at the vertices, and not normals of the faces # verts and normals have x and z flipped because skimage uses zyx ordering