Skip to content

Commit

Permalink
Production/Stable
Browse files Browse the repository at this point in the history
* automatic exclusion of atoms with zero radius from surface analysis
  (this creates artefacts especially with the triangulation in GITIM)
* Chacon-Tarazona support removed (contact developers to reintroduce it if needed)
* ready for integration in MDAKit (see https://github.com/MDAnalysis/MDAKits)
* version bump to 1.0.0
  • Loading branch information
Marcello-Sega committed Aug 6, 2024
1 parent 6be94f0 commit ded71b7
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 250 deletions.
7 changes: 7 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Marcello-Sega https://api.github.com/users/Marcello-Sega
gyorgy-hantal https://api.github.com/users/gyorgy-hantal
balazsfabian https://api.github.com/users/balazsfabian
elija-feigl https://api.github.com/users/elija-feigl
JakobMichl https://api.github.com/users/JakobMichl
iuvenis https://api.github.com/users/iuvenis
bnovak1 https://api.github.com/users/bnovak1
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ So far the following interface/phase identification methods have been implemente
* GITIM
* SASA
* Willard Chandler
* Chacon Tarazona
* DBSCAN filtering

## Supported formats
Expand Down Expand Up @@ -475,7 +474,5 @@ Depending on which algorithm you are using, you might also want to cite the foll

[M. Sega and G. Hantal._Phys. Chem. Chem. Phys._ **29**, 18968-18974 (2017)](https://doi.org/10.1039/C7CP02918G) Phase and interface determination in computer simulations of liquid mixtures with high partial miscibility.

[E. Chacón, P. Tarazona, Phys. Rev. Lett. **91**, 166103 (2003)](http://dx.doi.org/10.1103/PhysRevLett.91.166103) Intrinsic profiles beyond the capillary wave theory: A Monte Carlo study.

[A. P. Willard, D. Chandler, J. Phys. Chem. B **114**,1954 (2010)](http://dx.doi.org/10.1021/jp909219k) Instantaneous Liquid Interfaces

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ So far the following methods have been implemented:

* ITIM
* GITIM
* SASA
* Willard Chandler
* Chacon Tarazona
* DBSCAN filtering

----
Expand Down
16 changes: 0 additions & 16 deletions docs/source/ChaconTarazona.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
ITIM
GITIM
WillardChandler
ChaconTarazona
SimpleInterface
observables
datafiles
Expand Down
1 change: 0 additions & 1 deletion pytim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from .gitim import GITIM
from .sasa import SASA
from .willard_chandler import WillardChandler
from .chacon_tarazona import ChaconTarazona
from . import observables, utilities, datafiles
from .version import __version__
import warnings
Expand Down
221 changes: 0 additions & 221 deletions pytim/chacon_tarazona.py

This file was deleted.

9 changes: 8 additions & 1 deletion pytim/gitim.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class GITIM(Interface):
of the interface: 'generic' (default)
or 'planar'
:param bool centered: Center the :py:obj:`group`
:param bool include_zero_radius: if false (default) exclude atoms with zero radius
from the surface analysis (they are always included
in the cluster search, if present in the relevant
group) to avoid some artefacts.
:param bool info: Print additional info
:param bool warnings: Print warnings
:param bool autoassign: If true (default) detect the interface
Expand Down Expand Up @@ -124,6 +128,7 @@ def __init__(self,
max_layers=1,
radii_dict=None,
cluster_cut=None,
include_zero_radius=False,
cluster_threshold_density=None,
extra_cluster_groups=None,
biggest_cluster_only=False,
Expand Down Expand Up @@ -155,6 +160,7 @@ def __init__(self,
self.normal = None
self.PDB = {}
self.molecular = molecular
self.include_zero_radius = include_zero_radius
sanity.assign_cluster_params(cluster_cut,
cluster_threshold_density, extra_cluster_groups)
sanity.check_multiple_layers_options()
Expand Down Expand Up @@ -254,7 +260,8 @@ def _assign_layers_setup(self):
# then all atoms in the larges group are labelled as liquid-like
self.label_group(self.cluster_group.atoms, beta=0.0)

alpha_group = self.cluster_group[:]
if self.include_zero_radius: alpha_group = self.cluster_group[:]
else: alpha_group = self.cluster_group[self.cluster_group.radii > 0.0]

# TODO the successive layers analysis should be done by removing points
# from the triangulation and updating the circumradius of the neighbors
Expand Down
3 changes: 3 additions & 0 deletions pytim/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class Interface(object):
autoassign, _autoassign =\
_create_property('autoassign',
"(bool) assign layers every time a frame changes")
include_zero_radius, _include_zero_radius=\
_create_property('include_zero_radius',
"(bool) include atoms with zero radius in the analysis (excluded by default)")
cluster_threshold_density, _cluster_threshold_density =\
_create_property('cluster_threshold_density',
"(float) threshold for the density-based filtering")
Expand Down
8 changes: 8 additions & 0 deletions pytim/itim.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class ITIM(Interface):
search, if cluster_cut is not None
:param Object extra_cluster_groups: Additional groups, to allow for
mixed interfaces
:param bool include_zero_radius: if false (default) exclude atoms with zero radius
from the surface analysis (they are always included
in the cluster search, if present in the relevant
group) to avoid some artefacts.
:param bool info: Print additional info
:param bool centered: Center the :py:obj:`group`
:param bool warnings: Print warnings
Expand Down Expand Up @@ -186,6 +190,7 @@ def __init__(self,
max_layers=1,
radii_dict=None,
cluster_cut=None,
include_zero_radius=False,
cluster_threshold_density=None,
extra_cluster_groups=None,
info=False,
Expand Down Expand Up @@ -214,6 +219,7 @@ def __init__(self,
self.normal = None
self.PDB = {}
self.molecular = molecular
self.include_zero_radius = include_zero_radius

sanity.assign_cluster_params(cluster_cut,
cluster_threshold_density, extra_cluster_groups)
Expand Down Expand Up @@ -294,6 +300,8 @@ def _assign_one_side(self,
# atom here goes to 0 to #sorted_atoms, it is not a MDAnalysis
# index/atom
for atom in sorted_atoms:
if self.include_zero_radius == False and not (_radius[atom] > 0.0):
continue
if self._seen[uplow][atom] != 0:
continue

Expand Down
2 changes: 1 addition & 1 deletion pytim/observables/rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def sample(self, g1=None, g2=None, kargs1=None, kargs2=None):
self.count += count

box = self.universe.dimensions
self.volume += np.product(box[:3])
self.volume += np.prod(box[:3])
self.nsamples += 1
self.n_squared += len(self.g1) * len(self.g2)

Expand Down
Loading

0 comments on commit ded71b7

Please sign in to comment.