sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
def observe(self, dataset, kind, components=None, distance=1.0, l3=0.0, **kwargs):
"""
TODO: add documentation
Integrate over visible surface elements and return a dictionary of observable values
distance (m)
"""
meshes = self.meshes
if kind=='lp':
... | TODO: add documentation
Integrate over visible surface elements and return a dictionary of observable values
distance (m) | entailment |
def instantaneous_maxr(self):
"""
Recall the maximum r (triangle furthest from the center of the star) of
this star at the given time
:return: maximum r
:rtype: float
"""
logger.debug("{}.instantaneous_maxr".format(self.component))
if 'maxr' not in self.... | Recall the maximum r (triangle furthest from the center of the star) of
this star at the given time
:return: maximum r
:rtype: float | entailment |
def _get_mass_by_index(self, index):
"""
where index can either by an integer or a list of integers (returns some of masses)
"""
if hasattr(index, '__iter__'):
return sum([self.masses[i] for i in index])
else:
return self.masses[index] | where index can either by an integer or a list of integers (returns some of masses) | entailment |
def _get_coords_by_index(self, coords_array, index):
"""
where index can either by an integer or a list of integers (returns some of masses)
coords_array should be a single array (xs, ys, or zs)
"""
if hasattr(index, '__iter__'):
# then we want the center-of-mass coor... | where index can either by an integer or a list of integers (returns some of masses)
coords_array should be a single array (xs, ys, or zs) | entailment |
def get_standard_mesh(self, scaled=True):
"""
TODO: add documentation
"""
# TODO: allow this to take etheta and retreive a mesh at that true anomaly
theta = 0.0
protomesh = self._standard_meshes[theta] #.copy() # if theta in self._standard_meshes.keys() else self.mesh.cop... | TODO: add documentation | entailment |
def reset_time(self, time, true_anom, elongan, eincl):
"""
TODO: add documentation
"""
self.true_anom = true_anom
self.elongan = elongan
self.eincl = eincl
self.time = time
self.populated_at_time = []
self.reset()
return | TODO: add documentation | entailment |
def update_position(self, time,
xs, ys, zs, vxs, vys, vzs,
ethetas, elongans, eincls,
ds=None, Fs=None,
ignore_effects=False,
component_com_x=None,
**kwargs):
"""
... | Update the position of the star into its orbit
:parameter float time: the current time
:parameter list xs: a list/array of x-positions of ALL COMPONENTS in the :class:`System`
:parameter list ys: a list/array of y-positions of ALL COMPONENTS in the :class:`System`
:parameter list zs: a ... | entailment |
def populate_observable(self, time, kind, dataset, **kwargs):
"""
TODO: add documentation
"""
if kind in ['mesh', 'orb']:
return
if time==self.time and dataset in self.populated_at_time and 'pblum' not in kind:
# then we've already computed the needed co... | TODO: add documentation | entailment |
def from_bundle(cls, b, component, compute=None,
mesh_init_phi=0.0, datasets=[], **kwargs):
"""
Build a star from the :class:`phoebe.frontend.bundle.Bundle` and its
hierarchy.
Usually it makes more sense to call :meth:`System.from_bundle` directly.
:paramete... | Build a star from the :class:`phoebe.frontend.bundle.Bundle` and its
hierarchy.
Usually it makes more sense to call :meth:`System.from_bundle` directly.
:parameter b: the :class:`phoebe.frontend.bundle.Bundle`
:parameter str component: label of the component in the bundle
:para... | entailment |
def polar_direction_xyz(self):
"""
get current polar direction in Roche (xyz) coordinates
"""
return mesh.spin_in_roche(self.polar_direction_uvw,
self.true_anom, self.elongan, self.eincl).astype(float) | get current polar direction in Roche (xyz) coordinates | entailment |
def get_target_volume(self, etheta=0.0, scaled=False):
"""
TODO: add documentation
get the volume that the Star should have at a given euler theta
"""
# TODO: make this a function of d instead of etheta?
logger.debug("determining target volume at t={}, theta={}".format(s... | TODO: add documentation
get the volume that the Star should have at a given euler theta | entailment |
def north_pole_uvw(self):
"""location of the north pole in the global/system frame"""
# TODO: is this rpole scaling true for all distortion_methods??
rpole = self.instantaneous_rpole*self.sma
return self.polar_direction_uvw*rpole+self.mesh._pos | location of the north pole in the global/system frame | entailment |
def instantaneous_tpole(self):
"""
compute the instantaenous temperature at the pole to achieve the mean
effective temperature (teff) provided by the user
"""
logger.debug("{}.instantaneous_tpole".format(self.component))
if 'tpole' not in self.inst_vals.keys():
... | compute the instantaenous temperature at the pole to achieve the mean
effective temperature (teff) provided by the user | entailment |
def _fill_loggs(self, mesh=None, ignore_effects=False):
"""
TODO: add documentation
Calculate local surface gravity
GMSunNom = 1.3271244e20 m**3 s**-2
RSunNom = 6.597e8 m
"""
logger.debug("{}._fill_loggs".format(self.component))
if mesh is None:
... | TODO: add documentation
Calculate local surface gravity
GMSunNom = 1.3271244e20 m**3 s**-2
RSunNom = 6.597e8 m | entailment |
def _fill_gravs(self, mesh=None, **kwargs):
"""
TODO: add documentation
requires _fill_loggs to have been called
"""
logger.debug("{}._fill_gravs".format(self.component))
if mesh is None:
mesh = self.mesh
# TODO: rename 'gravs' to 'gdcs' (gravity da... | TODO: add documentation
requires _fill_loggs to have been called | entailment |
def _fill_teffs(self, mesh=None, ignore_effects=False, **kwargs):
r"""
requires _fill_loggs and _fill_gravs to have been called
Calculate local temperature of a Star.
"""
logger.debug("{}._fill_teffs".format(self.component))
if mesh is None:
mesh = self.mes... | r"""
requires _fill_loggs and _fill_gravs to have been called
Calculate local temperature of a Star. | entailment |
def _fill_abuns(self, mesh=None, abun=0.0):
"""
TODO: add documentation
"""
logger.debug("{}._fill_abuns".format(self.component))
if mesh is None:
mesh = self.mesh
# TODO: support from frontend
mesh.update_columns(abuns=abun)
if not self.ne... | TODO: add documentation | entailment |
def _fill_albedos(self, mesh=None, irrad_frac_refl=0.0):
"""
TODO: add documentation
"""
logger.debug("{}._fill_albedos".format(self.component))
if mesh is None:
mesh = self.mesh
mesh.update_columns(irrad_frac_refl=irrad_frac_refl)
if not self.needs... | TODO: add documentation | entailment |
def compute_pblum_scale(self, dataset, pblum, **kwargs):
"""
intensities should already be computed for this dataset at the time for which pblum is being provided
TODO: add documentation
"""
logger.debug("{}.compute_pblum_scale(dataset={}, pblum={})".format(self.component, datas... | intensities should already be computed for this dataset at the time for which pblum is being provided
TODO: add documentation | entailment |
def _populate_lp(self, dataset, **kwargs):
"""
Populate columns necessary for an LP dataset
This should not be called directly, but rather via :meth:`Body.populate_observable`
or :meth:`System.populate_observables`
"""
logger.debug("{}._populate_lp(dataset={})".format(se... | Populate columns necessary for an LP dataset
This should not be called directly, but rather via :meth:`Body.populate_observable`
or :meth:`System.populate_observables` | entailment |
def _populate_rv(self, dataset, **kwargs):
"""
Populate columns necessary for an RV dataset
This should not be called directly, but rather via :meth:`Body.populate_observable`
or :meth:`System.populate_observables`
"""
logger.debug("{}._populate_rv(dataset={})".format(se... | Populate columns necessary for an RV dataset
This should not be called directly, but rather via :meth:`Body.populate_observable`
or :meth:`System.populate_observables` | entailment |
def _populate_lc(self, dataset, **kwargs):
"""
Populate columns necessary for an LC dataset
This should not be called directly, but rather via :meth:`Body.populate_observable`
or :meth:`System.populate_observables`
:raises NotImplementedError: if lc_method is not supported
... | Populate columns necessary for an LC dataset
This should not be called directly, but rather via :meth:`Body.populate_observable`
or :meth:`System.populate_observables`
:raises NotImplementedError: if lc_method is not supported | entailment |
def needs_remesh(self):
"""
whether the star needs to be re-meshed (for any reason)
"""
# TODO: may be able to get away with removing the features check and just doing for pulsations, etc?
# TODO: what about dpdt, deccdt, dincldt, etc?
return len(self.features) > 0 or sel... | whether the star needs to be re-meshed (for any reason) | entailment |
def _build_mesh(self, mesh_method, **kwargs):
"""
this function takes mesh_method and kwargs that came from the generic Body.intialize_mesh and returns
the grid... intialize mesh then takes care of filling columns and rescaling to the correct units, etc
"""
# need the sma to sca... | this function takes mesh_method and kwargs that came from the generic Body.intialize_mesh and returns
the grid... intialize mesh then takes care of filling columns and rescaling to the correct units, etc | entailment |
def _build_mesh(self, mesh_method, **kwargs):
"""
this function takes mesh_method and kwargs that came from the generic Body.intialize_mesh and returns
the grid... intialize mesh then takes care of filling columns and rescaling to the correct units, etc
"""
# if we don't provide... | this function takes mesh_method and kwargs that came from the generic Body.intialize_mesh and returns
the grid... intialize mesh then takes care of filling columns and rescaling to the correct units, etc | entailment |
def populate_observable(self, time, kind, dataset, **kwargs):
"""
TODO: add documentation
"""
for half in self._halves:
half.populate_observable(time, kind, dataset, **kwargs) | TODO: add documentation | entailment |
def from_bundle(cls, b, feature):
"""
Initialize a Spot feature from the bundle.
"""
feature_ps = b.get_feature(feature)
colat = feature_ps.get_value('colat', unit=u.rad)
longitude = feature_ps.get_value('long', unit=u.rad)
if len(b.hierarchy.get_stars())>=2:
... | Initialize a Spot feature from the bundle. | entailment |
def pointing_vector(self, s, time):
"""
s is the spin vector in roche coordinates
time is the current time
"""
t = time - self._t0
longitude = self._longitude + self._dlongdt * t
# define the basis vectors in the spin (primed) coordinates in terms of
# th... | s is the spin vector in roche coordinates
time is the current time | entailment |
def process_teffs(self, teffs, coords, s=np.array([0., 0., 1.]), t=None):
"""
Change the local effective temperatures for any values within the
"cone" defined by the spot. Any teff within the spot will have its
current value multiplied by the "relteff" factor
:parameter array t... | Change the local effective temperatures for any values within the
"cone" defined by the spot. Any teff within the spot will have its
current value multiplied by the "relteff" factor
:parameter array teffs: array of teffs for computations
:parameter array coords: array of coords for com... | entailment |
def from_bundle(cls, b, feature):
"""
Initialize a Pulsation feature from the bundle.
"""
feature_ps = b.get_feature(feature)
freq = feature_ps.get_value('freq', unit=u.d**-1)
radamp = feature_ps.get_value('radamp', unit=u.dimensionless_unscaled)
l = feature_ps.g... | Initialize a Pulsation feature from the bundle. | entailment |
def project_onto_potential(r, pot_name, *args):
"""
TODO: add documentation
"""
pot = globals()[pot_name]
dpdx = globals()['d%sdx'%(pot_name)]
dpdy = globals()['d%sdy'%(pot_name)]
dpdz = globals()['d%sdz'%(pot_name)]
dpdr = globals()['d%sdr'%(pot_name)]
n_iter = 0
rmag, rmag0 ... | TODO: add documentation | entailment |
def discretize_wd_style(N, q, F, d, Phi):
"""
TODO: add documentation
New implementation. I'll make this work first, then document.
"""
DEBUG = False
Ts = []
potential = 'BinaryRoche'
r0 = libphoebe.roche_pole(q, F, d, Phi)
# The following is a hack that needs to go!
pot_nam... | TODO: add documentation
New implementation. I'll make this work first, then document. | entailment |
def open(cls, filename):
"""Open a new bundle.
Open a bundle from a JSON-formatted PHOEBE 2 file.
This is a constructor so should be called as:
>>> b = Bundle.open('test.phoebe')
:parameter str filename: relative or full path to the file
:return: instantiated :class:... | Open a new bundle.
Open a bundle from a JSON-formatted PHOEBE 2 file.
This is a constructor so should be called as:
>>> b = Bundle.open('test.phoebe')
:parameter str filename: relative or full path to the file
:return: instantiated :class:`Bundle` object | entailment |
def from_server(cls, bundleid, server='http://localhost:5555',
as_client=True):
"""Load a new bundle from a server.
[NOT IMPLEMENTED]
Load a bundle from a phoebe server. This is a constructor so should be
called as:
>>> b = Bundle.from_server('asdf', as_cl... | Load a new bundle from a server.
[NOT IMPLEMENTED]
Load a bundle from a phoebe server. This is a constructor so should be
called as:
>>> b = Bundle.from_server('asdf', as_client=False)
:parameter str bundleid: the identifier given to the bundle by the
server
... | entailment |
def from_legacy(cls, filename, add_compute_legacy=True, add_compute_phoebe=True):
"""Load a bundle from a PHOEBE 1.0 Legacy file.
This is a constructor so should be called as:
>>> b = Bundle.from_legacy('myfile.phoebe')
:parameter str filename: relative or full path to the file
... | Load a bundle from a PHOEBE 1.0 Legacy file.
This is a constructor so should be called as:
>>> b = Bundle.from_legacy('myfile.phoebe')
:parameter str filename: relative or full path to the file
:return: instantiated :class:`Bundle` object | entailment |
def default_star(cls, starA='starA', force_build=False):
"""
For convenience, this function is available at the top-level as
<phoebe.default_star> as well as <phoebe.frontend.bundle.Bundle.default_star>.
sun
This is a constructor, so should be called as:
>>> b = Bundle... | For convenience, this function is available at the top-level as
<phoebe.default_star> as well as <phoebe.frontend.bundle.Bundle.default_star>.
sun
This is a constructor, so should be called as:
>>> b = Bundle.default_binary()
Arguments
-----------
* `starA` (s... | entailment |
def default_binary(cls, starA='primary', starB='secondary', orbit='binary',
contact_binary=False, force_build=False):
"""
For convenience, this function is available at the top-level as
<phoebe.default_binary> as well as
<phoebe.frontend.bundle.Bundle.default_binar... | For convenience, this function is available at the top-level as
<phoebe.default_binary> as well as
<phoebe.frontend.bundle.Bundle.default_binary>.
primary - secondary
This is a constructor, so should be called as:
>>> b = Bundle.default_binary()
Arguments
----... | entailment |
def default_triple(cls, inner_as_primary=True, inner_as_overcontact=False,
starA='starA', starB='starB', starC='starC',
inner='inner', outer='outer',
contact_envelope='contact_envelope'):
"""Load a bundle with a default triple system.
... | Load a bundle with a default triple system.
Set inner_as_primary based on what hierarchical configuration you want.
inner_as_primary = True:
starA - starB -- starC
inner_as_primary = False:
starC -- starA - starB
This is a constructor, so should be called as:
... | entailment |
def save(self, filename, clear_history=True, incl_uniqueid=False,
compact=False):
"""Save the bundle to a JSON-formatted ASCII file.
:parameter str filename: relative or full path to the file
:parameter bool clear_history: whether to clear history log
items before savin... | Save the bundle to a JSON-formatted ASCII file.
:parameter str filename: relative or full path to the file
:parameter bool clear_history: whether to clear history log
items before saving (default: True)
:parameter bool incl_uniqueid: whether to including uniqueids in the
... | entailment |
def export_legacy(self, filename):
"""
TODO: add docs
"""
logger.warning("exporting to legacy is experimental until official 1.0 release")
filename = os.path.expanduser(filename)
return io.pass_to_legacy(self, filename) | TODO: add docs | entailment |
def _on_socket_push_updates(self, resp):
"""
[NOT IMPLEMENTED]
"""
# TODO: check to make sure resp['meta']['bundleid']==bundleid ?
# TODO: handle added parameters
# TODO: handle removed (isDeleted) parameters
for item in resp['data']:
if item['id'] in... | [NOT IMPLEMENTED] | entailment |
def _attach_param_from_server(self, item):
"""
[NOT IMPLEMENTED]
"""
if isinstance(item, list):
for itemi in item:
self._attach_param_from_server(itemi)
else:
# then we need to add a new parameter
d = item['attributes']
... | [NOT IMPLEMENTED] | entailment |
def as_client(self, as_client=True, server='http://localhost:5555',
bundleid=None):
"""
[NOT IMPLEMENTED]
"""
if as_client:
if not _can_client:
raise ImportError("dependencies to support client mode not met - see docs")
server_ru... | [NOT IMPLEMENTED] | entailment |
def client_update(self):
"""
[NOT IMPLEMENTED]
"""
if not self.is_client:
raise ValueError("Bundle is not in client mode, cannot update")
logger.info("updating client...")
# wait briefly to pickup any missed messages, which should then fire
# the corr... | [NOT IMPLEMENTED] | entailment |
def _default_label(self, base, context, **kwargs):
"""
Determine a default label given a base label and the passed kwargs
this simply counts the current number of matches on metawargs and
appends that number to the base
:parameter str base: the base string for the label
... | Determine a default label given a base label and the passed kwargs
this simply counts the current number of matches on metawargs and
appends that number to the base
:parameter str base: the base string for the label
:parameter str context: name of the context (where the label is going)... | entailment |
def get_setting(self, twig=None, **kwargs):
"""
Filter in the 'setting' context
:parameter str twig: the twig used for filtering
:parameter **kwargs: any other tags to do the filter (except tag or
context)
:return: :class:`phoebe.parameters.parameters.ParameterSet`
... | Filter in the 'setting' context
:parameter str twig: the twig used for filtering
:parameter **kwargs: any other tags to do the filter (except tag or
context)
:return: :class:`phoebe.parameters.parameters.ParameterSet` | entailment |
def _add_history(self, redo_func, redo_kwargs, undo_func, undo_kwargs,
**kwargs):
"""
Add a new log (undo/redoable) to this history context
:parameter str redo_func: function to redo the action, must be a
method of :class:`Bundle`
:parameter dict redo_kw... | Add a new log (undo/redoable) to this history context
:parameter str redo_func: function to redo the action, must be a
method of :class:`Bundle`
:parameter dict redo_kwargs: kwargs to pass to the redo_func. Each
item must be serializable (float or str, not objects)
:par... | entailment |
def get_history(self, i=None):
"""
Get a history item by index.
You can toggle whether history is recorded using
* :meth:`enable_history`
* :meth:`disable_history`
:parameter int i: integer for indexing (can be positive or
negative). If i is None or... | Get a history item by index.
You can toggle whether history is recorded using
* :meth:`enable_history`
* :meth:`disable_history`
:parameter int i: integer for indexing (can be positive or
negative). If i is None or not provided, the entire list
of histo... | entailment |
def remove_history(self, i=None):
"""
Remove a history item from the bundle by index.
You can toggle whether history is recorded using
* :meth:`enable_history`
* :meth:`disable_history`
:parameter int i: integer for indexing (can be positive or
nega... | Remove a history item from the bundle by index.
You can toggle whether history is recorded using
* :meth:`enable_history`
* :meth:`disable_history`
:parameter int i: integer for indexing (can be positive or
negative). If i is None or not provided, the entire list
... | entailment |
def undo(self, i=-1):
"""
Undo an item in the history logs
:parameter int i: integer for indexing (can be positive or
negative). Defaults to -1 if not provided (the latest
recorded history item)
:raises ValueError: if no history items have been recorded
... | Undo an item in the history logs
:parameter int i: integer for indexing (can be positive or
negative). Defaults to -1 if not provided (the latest
recorded history item)
:raises ValueError: if no history items have been recorded | entailment |
def set_hierarchy(self, *args, **kwargs):
"""
Set the hierarchy of the system.
See tutorial on building a system.
TODO: provide documentation
args can be
- string representation (preferably passed through hierarchy already)
- func and strings/PSs/params to pass ... | Set the hierarchy of the system.
See tutorial on building a system.
TODO: provide documentation
args can be
- string representation (preferably passed through hierarchy already)
- func and strings/PSs/params to pass to function | entailment |
def get_system(self, twig=None, **kwargs):
"""
Filter in the 'system' context
:parameter str twig: twig to use for filtering
:parameter **kwargs: any other tags to do the filter
(except twig or context)
:return: :class:`phoebe.parameters.parameters.Parameter` or
... | Filter in the 'system' context
:parameter str twig: twig to use for filtering
:parameter **kwargs: any other tags to do the filter
(except twig or context)
:return: :class:`phoebe.parameters.parameters.Parameter` or
:class:`phoebe.parameters.parameters.ParameterSet` | entailment |
def run_checks(self, **kwargs):
"""
Check to see whether the system is expected to be computable.
This is called by default for each set_value but will only raise a
logger warning if fails. This is also called immediately when calling
:meth:`run_compute`.
kwargs are pa... | Check to see whether the system is expected to be computable.
This is called by default for each set_value but will only raise a
logger warning if fails. This is also called immediately when calling
:meth:`run_compute`.
kwargs are passed to override currently set values as if they wer... | entailment |
def add_feature(self, kind, component=None, **kwargs):
"""
Add a new feature (spot, etc) to a component in the system. If not
provided, 'feature' (the name of the new feature) will be created
for you and can be accessed by the 'feature' attribute of the returned
ParameterSet
... | Add a new feature (spot, etc) to a component in the system. If not
provided, 'feature' (the name of the new feature) will be created
for you and can be accessed by the 'feature' attribute of the returned
ParameterSet
>>> b.add_feature(feature.spot, component='mystar')
or
... | entailment |
def get_feature(self, feature=None, **kwargs):
"""
Filter in the 'proerty' context
:parameter str feature: name of the feature (optional)
:parameter **kwargs: any other tags to do the filter
(except component or context)
:return: :class:`phoebe.parameters.parameters.... | Filter in the 'proerty' context
:parameter str feature: name of the feature (optional)
:parameter **kwargs: any other tags to do the filter
(except component or context)
:return: :class:`phoebe.parameters.parameters.ParameterSet` | entailment |
def remove_feature(self, feature=None, **kwargs):
"""
[NOT IMPLEMENTED]
Remove a 'feature' from the bundle
:raises NotImplementedError: because this isn't implemented yet
"""
self._kwargs_checks(kwargs)
# Let's avoid deleting ALL features from the matching cont... | [NOT IMPLEMENTED]
Remove a 'feature' from the bundle
:raises NotImplementedError: because this isn't implemented yet | entailment |
def rename_feature(self, old_feature, new_feature):
"""
Change the label of a feature attached to the Bundle
:parameter str old_feature: the current name of the feature
(must exist)
:parameter str new_feature: the desired new name of the feature
(must not exist)
... | Change the label of a feature attached to the Bundle
:parameter str old_feature: the current name of the feature
(must exist)
:parameter str new_feature: the desired new name of the feature
(must not exist)
:return: None
:raises ValueError: if the new_feature is ... | entailment |
def add_spot(self, component=None, feature=None, **kwargs):
"""
Shortcut to :meth:`add_feature` but with kind='spot'
"""
if component is None:
if len(self.hierarchy.get_stars())==1:
component = self.hierarchy.get_stars()[0]
else:
ra... | Shortcut to :meth:`add_feature` but with kind='spot' | entailment |
def get_spot(self, feature=None, **kwargs):
"""
Shortcut to :meth:`get_feature` but with kind='spot'
"""
kwargs.setdefault('kind', 'spot')
return self.get_feature(feature, **kwargs) | Shortcut to :meth:`get_feature` but with kind='spot' | entailment |
def remove_spot(self, feature=None, **kwargs):
"""
[NOT IMPLEMENTED]
Shortcut to :meth:`remove_feature` but with kind='spot'
"""
kwargs.setdefault('kind', 'spot')
return self.remove_feature(feature, **kwargs) | [NOT IMPLEMENTED]
Shortcut to :meth:`remove_feature` but with kind='spot' | entailment |
def add_component(self, kind, **kwargs):
"""
Add a new component (star or orbit) to the system. If not provided,
'component' (the name of the new star or orbit) will be created for
you and can be accessed by the 'component' attribute of the returned
ParameterSet.
>>> b.... | Add a new component (star or orbit) to the system. If not provided,
'component' (the name of the new star or orbit) will be created for
you and can be accessed by the 'component' attribute of the returned
ParameterSet.
>>> b.add_component(component.star)
or
>>> b.add_... | entailment |
def get_component(self, component=None, **kwargs):
"""
Filter in the 'component' context
:parameter str component: name of the component (optional)
:parameter **kwargs: any other tags to do the filter
(except component or context)
:return: :class:`phoebe.parameters.p... | Filter in the 'component' context
:parameter str component: name of the component (optional)
:parameter **kwargs: any other tags to do the filter
(except component or context)
:return: :class:`phoebe.parameters.parameters.ParameterSet` | entailment |
def remove_component(self, component, **kwargs):
"""
[NOT IMPLEMENTED]
Remove a 'component' from the bundle
:raises NotImplementedError: because this isn't implemented yet
"""
# NOTE: run_checks will check if an entry is in the hierarchy but has no parameters
kw... | [NOT IMPLEMENTED]
Remove a 'component' from the bundle
:raises NotImplementedError: because this isn't implemented yet | entailment |
def rename_component(self, old_component, new_component):
"""
Change the label of a component attached to the Bundle
:parameter str old_component: the current name of the component
(must exist)
:parameter str new_component: the desired new name of the component
(... | Change the label of a component attached to the Bundle
:parameter str old_component: the current name of the component
(must exist)
:parameter str new_component: the desired new name of the component
(must not exist)
:return: None
:raises ValueError: if the new_c... | entailment |
def add_orbit(self, component=None, **kwargs):
"""
Shortcut to :meth:`add_component` but with kind='orbit'
"""
kwargs.setdefault('component', component)
return self.add_component('orbit', **kwargs) | Shortcut to :meth:`add_component` but with kind='orbit' | entailment |
def get_orbit(self, component=None, **kwargs):
"""
Shortcut to :meth:`get_component` but with kind='star'
"""
kwargs.setdefault('kind', 'orbit')
return self.get_component(component, **kwargs) | Shortcut to :meth:`get_component` but with kind='star' | entailment |
def remove_orbit(self, component=None, **kwargs):
"""
[NOT IMPLEMENTED]
Shortcut to :meth:`remove_component` but with kind='star'
"""
kwargs.setdefault('kind', 'orbit')
return self.remove_component(component, **kwargs) | [NOT IMPLEMENTED]
Shortcut to :meth:`remove_component` but with kind='star' | entailment |
def add_star(self, component=None, **kwargs):
"""
Shortcut to :meth:`add_component` but with kind='star'
"""
kwargs.setdefault('component', component)
return self.add_component('star', **kwargs) | Shortcut to :meth:`add_component` but with kind='star' | entailment |
def get_star(self, component=None, **kwargs):
"""
Shortcut to :meth:`get_component` but with kind='star'
"""
kwargs.setdefault('kind', 'star')
return self.get_component(component, **kwargs) | Shortcut to :meth:`get_component` but with kind='star' | entailment |
def remove_star(self, component=None, **kwargs):
"""
[NOT IMPLEMENTED]
Shortcut to :meth:`remove_component` but with kind='star'
"""
kwargs.setdefault('kind', 'star')
return self.remove_component(component, **kwargs) | [NOT IMPLEMENTED]
Shortcut to :meth:`remove_component` but with kind='star' | entailment |
def add_envelope(self, component=None, **kwargs):
"""
[NOT SUPPORTED]
Shortcut to :meth:`add_component` but with kind='envelope'
"""
kwargs.setdefault('component', component)
return self.add_component('envelope', **kwargs) | [NOT SUPPORTED]
Shortcut to :meth:`add_component` but with kind='envelope' | entailment |
def get_envelope(self, component=None, **kwargs):
"""
[NOT SUPPORTED]
Shortcut to :meth:`get_component` but with kind='envelope'
"""
kwargs.setdefault('kind', 'envelope')
return self.get_component(component, **kwargs) | [NOT SUPPORTED]
Shortcut to :meth:`get_component` but with kind='envelope' | entailment |
def remove_envelope(self, component=None, **kwargs):
"""
[NOT SUPPORTED]
[NOT IMPLEMENTED]
Shortcut to :meth:`remove_component` but with kind='envelope'
"""
kwargs.setdefault('kind', 'envelope')
return self.remove_component(component, **kwargs) | [NOT SUPPORTED]
[NOT IMPLEMENTED]
Shortcut to :meth:`remove_component` but with kind='envelope' | entailment |
def get_ephemeris(self, component=None, t0='t0_supconj', **kwargs):
"""
Get the ephemeris of a component (star or orbit)
:parameter str component: name of the component. If not given,
component will default to the top-most level of the current
hierarchy
:paramet... | Get the ephemeris of a component (star or orbit)
:parameter str component: name of the component. If not given,
component will default to the top-most level of the current
hierarchy
:parameter t0: qualifier of the parameter to be used for t0
:type t0: str
:param... | entailment |
def to_phase(self, time, component=None, t0='t0_supconj', **kwargs):
"""
Get the phase(s) of a time(s) for a given ephemeris
:parameter time: time to convert to phases (should be in same system
as t0s)
:type time: float, list, or array
:parameter t0: qualifier of the... | Get the phase(s) of a time(s) for a given ephemeris
:parameter time: time to convert to phases (should be in same system
as t0s)
:type time: float, list, or array
:parameter t0: qualifier of the parameter to be used for t0
:type t0: str
:parameter str component: comp... | entailment |
def to_time(self, phase, component=None, t0='t0_supconj', **kwargs):
"""
Get the time(s) of a phase(s) for a given ephemeris
:parameter phase: phase to convert to times (should be in
same system as t0s)
:type phase: float, list, or array
` :parameter str component: com... | Get the time(s) of a phase(s) for a given ephemeris
:parameter phase: phase to convert to times (should be in
same system as t0s)
:type phase: float, list, or array
` :parameter str component: component for which to get the ephemeris.
If not given, component will default t... | entailment |
def add_dataset(self, kind, component=None, **kwargs):
"""
Add a new dataset to the bundle. If not provided,
'dataset' (the name of the new dataset) will be created for
you and can be accessed by the 'dataset' attribute of the returned
ParameterSet.
For light curves, th... | Add a new dataset to the bundle. If not provided,
'dataset' (the name of the new dataset) will be created for
you and can be accessed by the 'dataset' attribute of the returned
ParameterSet.
For light curves, the light curve will be generated for the entire system.
For radial ... | entailment |
def get_dataset(self, dataset=None, **kwargs):
"""
Filter in the 'dataset' context
:parameter str dataset: name of the dataset (optional)
:parameter **kwargs: any other tags to do the filter
(except dataset or context)
:return: :class:`phoebe.parameters.parameters.Pa... | Filter in the 'dataset' context
:parameter str dataset: name of the dataset (optional)
:parameter **kwargs: any other tags to do the filter
(except dataset or context)
:return: :class:`phoebe.parameters.parameters.ParameterSet` | entailment |
def remove_dataset(self, dataset=None, **kwargs):
""" Remove a dataset from the Bundle.
This removes all matching Parameters from the dataset, model, and
constraint contexts (by default if the context tag is not provided).
You must provide some sort of filter or this will raise an Erro... | Remove a dataset from the Bundle.
This removes all matching Parameters from the dataset, model, and
constraint contexts (by default if the context tag is not provided).
You must provide some sort of filter or this will raise an Error (so
that all Parameters are not accidentally removed... | entailment |
def rename_dataset(self, old_dataset, new_dataset):
"""
Change the label of a dataset attached to the Bundle
:parameter str old_dataset: the current name of the dataset
(must exist)
:parameter str new_dataset: the desired new name of the dataset
(must not exist)
... | Change the label of a dataset attached to the Bundle
:parameter str old_dataset: the current name of the dataset
(must exist)
:parameter str new_dataset: the desired new name of the dataset
(must not exist)
:return: None
:raises ValueError: if the new_dataset is ... | entailment |
def enable_dataset(self, dataset=None, **kwargs):
"""
Enable a 'dataset'. Datasets that are enabled will be computed
during :meth:`run_compute` and included in the cost function
during :meth:`run_fitting`.
If compute is not provided, the dataset will be enabled across all
... | Enable a 'dataset'. Datasets that are enabled will be computed
during :meth:`run_compute` and included in the cost function
during :meth:`run_fitting`.
If compute is not provided, the dataset will be enabled across all
compute options.
:parameter str dataset: name of the datas... | entailment |
def disable_dataset(self, dataset=None, **kwargs):
"""
Disable a 'dataset'. Datasets that are enabled will be computed
during :meth:`run_compute` and included in the cost function
during :meth:`run_fitting`.
If compute is not provided, the dataset will be disabled across all
... | Disable a 'dataset'. Datasets that are enabled will be computed
during :meth:`run_compute` and included in the cost function
during :meth:`run_fitting`.
If compute is not provided, the dataset will be disabled across all
compute options.
:parameter str dataset: name of the dat... | entailment |
def add_constraint(self, *args, **kwargs):
"""
TODO: add documentation
args can be string representation (length 1)
func and strings to pass to function
"""
# TODO: be smart enough to take kwargs (especially for undoing a
# remove_constraint) for kind, value (exp... | TODO: add documentation
args can be string representation (length 1)
func and strings to pass to function | entailment |
def get_constraint(self, twig=None, **kwargs):
"""
Filter in the 'constraint' context
:parameter str constraint: name of the constraint (optional)
:parameter **kwargs: any other tags to do the filter
(except constraint or context)
:return: :class:`phoebe.parameters.p... | Filter in the 'constraint' context
:parameter str constraint: name of the constraint (optional)
:parameter **kwargs: any other tags to do the filter
(except constraint or context)
:return: :class:`phoebe.parameters.parameters.ParameterSet` | entailment |
def remove_constraint(self, twig=None, **kwargs):
"""
Remove a 'constraint' from the bundle
:parameter str twig: twig to filter for the constraint
:parameter **kwargs: any other tags to do the filter
(except twig or context)
"""
# let's run delayed constraint... | Remove a 'constraint' from the bundle
:parameter str twig: twig to filter for the constraint
:parameter **kwargs: any other tags to do the filter
(except twig or context) | entailment |
def flip_constraint(self, twig=None, solve_for=None, **kwargs):
"""
Flip an existing constraint to solve for a different parameter
:parameter str twig: twig to filter the constraint
:parameter solve_for: twig or actual parameter object of the new
parameter which this constra... | Flip an existing constraint to solve for a different parameter
:parameter str twig: twig to filter the constraint
:parameter solve_for: twig or actual parameter object of the new
parameter which this constraint should constraint (solve for).
:type solve_for: str or :class:`phoebe.pa... | entailment |
def run_constraint(self, twig=None, return_parameter=False, **kwargs):
"""
Run a given 'constraint' now and set the value of the constrained
parameter. In general, there shouldn't be any need to manually
call this - constraints should automatically be run whenever a
dependent pa... | Run a given 'constraint' now and set the value of the constrained
parameter. In general, there shouldn't be any need to manually
call this - constraints should automatically be run whenever a
dependent parameter's value is change.
:parameter str twig: twig to filter for the constraint
... | entailment |
def compute_pblums(self, compute=None, **kwargs):
"""
Compute the passband luminosities that will be applied to the system,
following all coupling, etc, as well as all relevant compute options
(ntriangles, distortion_method, etc). The exposed passband luminosities
(and any coupl... | Compute the passband luminosities that will be applied to the system,
following all coupling, etc, as well as all relevant compute options
(ntriangles, distortion_method, etc). The exposed passband luminosities
(and any coupling) are computed at t0@system.
This method is only for conve... | entailment |
def add_compute(self, kind=compute.phoebe, **kwargs):
"""
Add a set of computeoptions for a given backend to the bundle.
The label ('compute') can then be sent to :meth:`run_compute`.
If not provided, 'compute' will be created for you and can be
accessed by the 'compute' attribu... | Add a set of computeoptions for a given backend to the bundle.
The label ('compute') can then be sent to :meth:`run_compute`.
If not provided, 'compute' will be created for you and can be
accessed by the 'compute' attribute of the returned
ParameterSet.
Available kinds include:... | entailment |
def get_compute(self, compute=None, **kwargs):
"""
Filter in the 'compute' context
:parameter str compute: name of the compute options (optional)
:parameter **kwargs: any other tags to do the filter
(except compute or context)
:return: :class:`phoebe.parameters.param... | Filter in the 'compute' context
:parameter str compute: name of the compute options (optional)
:parameter **kwargs: any other tags to do the filter
(except compute or context)
:return: :class:`phoebe.parameters.parameters.ParameterSet` | entailment |
def remove_compute(self, compute, **kwargs):
"""
Remove a 'compute' from the bundle
:parameter str compute: name of the compute options
:parameter **kwargs: any other tags to do the filter
(except twig or context)
:raise NotImplementedError: because it isn't
... | Remove a 'compute' from the bundle
:parameter str compute: name of the compute options
:parameter **kwargs: any other tags to do the filter
(except twig or context)
:raise NotImplementedError: because it isn't | entailment |
def rename_compute(self, old_compute, new_compute):
"""
Change the label of a compute attached to the Bundle
:parameter str old_compute: the current name of the compute options
(must exist)
:parameter str new_compute: the desired new name of the compute options
(... | Change the label of a compute attached to the Bundle
:parameter str old_compute: the current name of the compute options
(must exist)
:parameter str new_compute: the desired new name of the compute options
(must not exist)
:return: None
:raises ValueError: if the... | entailment |
def run_compute(self, compute=None, model=None, detach=False,
times=None, **kwargs):
"""
Run a forward model of the system on the enabled dataset using
a specified set of compute options.
To attach and set custom values for compute options, including choosing
... | Run a forward model of the system on the enabled dataset using
a specified set of compute options.
To attach and set custom values for compute options, including choosing
which backend to use, see:
* :meth:`add_compute`
To define the dataset types and times at which the mod... | entailment |
def get_model(self, model=None, **kwargs):
"""
Filter in the 'model' context
:parameter str model: name of the model (optional)
:parameter **kwargs: any other tags to do the filter
(except model or context)
:return: :class:`phoebe.parameters.parameters.ParameterSet`
... | Filter in the 'model' context
:parameter str model: name of the model (optional)
:parameter **kwargs: any other tags to do the filter
(except model or context)
:return: :class:`phoebe.parameters.parameters.ParameterSet` | entailment |
def remove_model(self, model, **kwargs):
"""
Remove a 'model' from the bundle
:parameter str twig: twig to filter for the model
:parameter **kwargs: any other tags to do the filter
(except twig or context)
"""
kwargs['model'] = model
kwargs['context']... | Remove a 'model' from the bundle
:parameter str twig: twig to filter for the model
:parameter **kwargs: any other tags to do the filter
(except twig or context) | entailment |
def rename_model(self, old_model, new_model):
"""
Change the label of a model attached to the Bundle
:parameter str old_model: the current name of the model
(must exist)
:parameter str new_model: the desired new name of the model
(must not exist)
:return:... | Change the label of a model attached to the Bundle
:parameter str old_model: the current name of the model
(must exist)
:parameter str new_model: the desired new name of the model
(must not exist)
:return: None
:raises ValueError: if the new_model is forbidden | entailment |
def add_prior(self, twig=None, **kwargs):
"""
[NOT IMPLEMENTED]
:raises NotImplementedError: because it isn't
"""
raise NotImplementedError
param = self.get_parameter(twig=twig, **kwargs)
# TODO: make sure param is a float parameter?
func = _get_add_fu... | [NOT IMPLEMENTED]
:raises NotImplementedError: because it isn't | entailment |
def get_prior(self, twig=None, **kwargs):
"""
[NOT IMPLEMENTED]
:raises NotImplementedError: because it isn't
"""
raise NotImplementedError
kwargs['context'] = 'prior'
return self.filter(twig=twig, **kwargs) | [NOT IMPLEMENTED]
:raises NotImplementedError: because it isn't | entailment |
def get_fitting(self, fitting=None, **kwargs):
"""
[NOT IMPLEMENTED]
:raises NotImplementedError: because it isn't
"""
raise NotImplementedError
if fitting is not None:
kwargs['fitting'] = fitting
kwargs['context'] = 'fitting'
return self.filt... | [NOT IMPLEMENTED]
:raises NotImplementedError: because it isn't | entailment |
def get_posterior(self, twig=None, feedback=None, **kwargs):
"""
[NOT IMPLEMENTED]
:raises NotImplementedError: because it isn't
"""
raise NotImplementedError
kwargs['context'] = 'posterior'
return self.filter(twig=twig, **kwargs) | [NOT IMPLEMENTED]
:raises NotImplementedError: because it isn't | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.