[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Jun 20 11:08:16 PDT 2014
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/64d7a213f153/
Changeset: 64d7a213f153
Branch: yt-3.0
User: ngoldbaum
Date: 2014-06-20 00:16:39
Summary: Improve the docstrings for add_field
Affected #: 2 files
diff -r 3c1a3d3de75acd092950c66c4915be4b6dce4bef -r 64d7a213f153c462947fa956cbfc778f7d63c011 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -661,6 +661,34 @@
def add_field(self, name, function=None, **kwargs):
"""
Dataset-specific call to add_field
+
+ Add a new field, along with supplemental metadata, to the list of
+ available fields. This respects a number of arguments, all of which
+ are passed on to the constructor for
+ :class:`~yt.data_objects.api.DerivedField`.
+
+ Parameters
+ ----------
+
+ name : str
+ is the name of the field.
+ function : callable
+ A function handle that defines the field. Should accept
+ arguments (field, data)
+ units : str
+ A plain text string encoding the unit. Powers must be in
+ python syntax (** instead of ^).
+ take_log : bool
+ Describes whether the field should be logged
+ validators : list
+ A list of :class:`FieldValidator` objects
+ particle_type : bool
+ Is this a particle (1D) field?
+ vector_field : bool
+ Describes the dimensionality of the field. Currently unused.
+ display_name : str
+ A name used in the plots
+
"""
self.index
self.field_info.add_field(name, function=function, **kwargs)
diff -r 3c1a3d3de75acd092950c66c4915be4b6dce4bef -r 64d7a213f153c462947fa956cbfc778f7d63c011 yt/fields/field_info_container.py
--- a/yt/fields/field_info_container.py
+++ b/yt/fields/field_info_container.py
@@ -159,6 +159,28 @@
are passed on to the constructor for
:class:`~yt.data_objects.api.DerivedField`.
+ Parameters
+ ----------
+
+ name : str
+ is the name of the field.
+ function : callable
+ A function handle that defines the field. Should accept
+ arguments (field, data)
+ units : str
+ A plain text string encoding the unit. Powers must be in
+ python syntax (** instead of ^).
+ take_log : bool
+ Describes whether the field should be logged
+ validators : list
+ A list of :class:`FieldValidator` objects
+ particle_type : bool
+ Is this a particle (1D) field?
+ vector_field : bool
+ Describes the dimensionality of the field. Currently unused.
+ display_name : str
+ A name used in the plots
+
"""
override = kwargs.pop("force_override", False)
if not override and name in self: return
https://bitbucket.org/yt_analysis/yt/commits/93f97b13eb7f/
Changeset: 93f97b13eb7f
Branch: yt-3.0
User: MatthewTurk
Date: 2014-06-20 20:08:07
Summary: Merged in ngoldbaum/yt/yt-3.0 (pull request #967)
Improve the docstrings for add_field
Affected #: 2 files
diff -r 7d2bf07d5de1c71380f61b0c4310f1b002b569b9 -r 93f97b13eb7ff1509cc45457a17574c19d91f5fb yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -661,6 +661,34 @@
def add_field(self, name, function=None, **kwargs):
"""
Dataset-specific call to add_field
+
+ Add a new field, along with supplemental metadata, to the list of
+ available fields. This respects a number of arguments, all of which
+ are passed on to the constructor for
+ :class:`~yt.data_objects.api.DerivedField`.
+
+ Parameters
+ ----------
+
+ name : str
+ is the name of the field.
+ function : callable
+ A function handle that defines the field. Should accept
+ arguments (field, data)
+ units : str
+ A plain text string encoding the unit. Powers must be in
+ python syntax (** instead of ^).
+ take_log : bool
+ Describes whether the field should be logged
+ validators : list
+ A list of :class:`FieldValidator` objects
+ particle_type : bool
+ Is this a particle (1D) field?
+ vector_field : bool
+ Describes the dimensionality of the field. Currently unused.
+ display_name : str
+ A name used in the plots
+
"""
self.index
self.field_info.add_field(name, function=function, **kwargs)
diff -r 7d2bf07d5de1c71380f61b0c4310f1b002b569b9 -r 93f97b13eb7ff1509cc45457a17574c19d91f5fb yt/fields/field_info_container.py
--- a/yt/fields/field_info_container.py
+++ b/yt/fields/field_info_container.py
@@ -159,6 +159,28 @@
are passed on to the constructor for
:class:`~yt.data_objects.api.DerivedField`.
+ Parameters
+ ----------
+
+ name : str
+ is the name of the field.
+ function : callable
+ A function handle that defines the field. Should accept
+ arguments (field, data)
+ units : str
+ A plain text string encoding the unit. Powers must be in
+ python syntax (** instead of ^).
+ take_log : bool
+ Describes whether the field should be logged
+ validators : list
+ A list of :class:`FieldValidator` objects
+ particle_type : bool
+ Is this a particle (1D) field?
+ vector_field : bool
+ Describes the dimensionality of the field. Currently unused.
+ display_name : str
+ A name used in the plots
+
"""
override = kwargs.pop("force_override", False)
if not override and name in self: return
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list