code stringlengths 1 18.2k |
|---|
def _init_map(self): """stub""" super(CalculationInteractionQuestionFormRecord, self)._init_map() QuestionTextFormRecord._init_map(self) QuestionFilesFormRecord._init_map(self) self.my_osid_object_form._my_map['text']['text'] = '' self.my_osid_object_form._my_map['variables'] = \ self._variables_metadata['default_objec... |
def _init_metadata(self): """stub""" super(CalculationInteractionQuestionFormRecord, self)._init_metadata() QuestionTextFormRecord._init_metadata(self) QuestionFilesFormRecord._init_metadata(self) self._variables_metadata = { 'element_id': Id(self.my_osid_object_form._authority, self.my_osid_object_form._namespace, 'va... |
def _init_map(self): """call these all manually because non-cooperative""" DecimalValuesFormRecord._init_map(self) IntegerValuesFormRecord._init_map(self) TextAnswerFormRecord._init_map(self) FilesAnswerFormRecord._init_map(self) FeedbackAnswerFormRecord._init_map(self) super(CalculationInteractionFeedbackAndFilesAnswe... |
def _init_map(self): """stub""" super(MultiLanguageCalculationInteractionQuestionFormRecord, self)._init_map() MultiLanguageQuestionFormRecord._init_map(self) QuestionFilesFormRecord._init_map(self) self.my_osid_object_form._my_map['variables'] = \ self._variables_metadata['default_object_values'][0] self.my_osid_objec... |
def _init_map(self): """call these all manually because non-cooperative""" DecimalValuesFormRecord._init_map(self) IntegerValuesFormRecord._init_map(self) TextAnswerFormRecord._init_map(self) super(MultiLanguageCalculationInteractionFeedbackAndFilesAnswerFormRecord, self)._init_map() self.my_osid_object_form._my_map['t... |
def _init_metadata(self): """stub""" DecimalValuesFormRecord._init_metadata(self) IntegerValuesFormRecord._init_metadata(self) TextAnswerFormRecord._init_metadata(self) super(MultiLanguageCalculationInteractionFeedbackAndFilesAnswerFormRecord, self)._init_metadata() self._tolerance_mode_metadata = { 'element_id': Id(se... |
def get_relationships_for_source_on_date(self, source_id, from_, to): """Pass through to provider RelationshipLookupSession.get_relationships_for_source_on_date""" # Implemented from azosid template for - # osid.relationship.RelationshipLookupSession.get_relationships_for_source_on_date_template if self._can('lookup'):... |
def get_relationships_by_search(self, relationship_query, relationship_search): """Pass through to provider RelationshipSearchSession.get_relationships_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_resources_by_search_template if not self._can('search'): raise Permissio... |
def _set_agency_view(self, session): """Sets the underlying agency view to match current view""" if self._agency_view == COMPARATIVE: try: session.use_comparative_agency_view() except AttributeError: pass else: try: session.use_plenary_agency_view() except AttributeError: pass |
def to_file(data, filename_or_file_object): """ Write ``data`` to a file specified by either filename of the file or an opened :class:`file` buffer. :param data: Object to write to file :param filename_or_file_object: filename/or opened file buffer to write to :type filename_or_file_object: basestring|file """ if isins... |
def from_file(filename_or_file_object): """ Read data from the specified file. :param filename_or_file_object: filename of the file or an opened :class:`file` buffer to that file :type filename_or_file_object: basestring|file :return: """ if isinstance(filename_or_file_object, basestring): file_ = open(filename_or_file... |
def from_file(cls, filename_or_file_object): """ Create new instance of the object from the file. :param filename_or_file_object: the filename of the file to read from or already opened file buffer :type filename_or_file_object: basestring|file """ object_ = from_file(filename_or_file_object) if not isinstance(object_,... |
def history(self, hash): """ Retrieve the ownership tree of all editions of a piece given the hash. Args: hash (str): Hash of the file to check. Can be created with the :class:`File` class Returns: dict: Ownsership tree of all editions of a piece. .. note:: For now we only support searching the blockchain by the piece ... |
lets update the records with the number of editions of the piece since we do not know # this information before the EDITIONS transaction for edition, chain in tree.items(): [d.update({'number_editions': number_editions}) for d in chain] return dict(tree) |
def chain(tree, edition_number): """ Args: tree (dict): Tree history of all editions of a piece. edition_number (int): The edition number to check for. In the case of a piece (master edition), an empty string (``''``) or zero (``0``) can be passed. Returns: list: The chain of ownsership of a particular edition of the p... |
def check_script(vouts): """ Looks into the vouts list of a transaction and returns the ``op_return`` if one exists. Args; vouts (list): List of outputs of a transaction. Returns: str: String representation of the ``op_return``. Raises: Exception: If no ``vout`` having a supported verb (:attr:`supported_actions`) is fo... |
def _get_addresses(tx): """ Checks for the from, to, and piece address of a SPOOL transaction. Args: tx (dict): Transaction payload, as returned by :meth:`transactions.Transactions.get()`. .. note:: Formats as returned by JSON-RPC API ``decoderawtransaction`` have yet to be supported. Returns: Tuple([str]): Sender, rec... |
def _get_time_utc(time_utc_str): """ Convert a string representation of the time (as returned by blockr.io api) into unix timestamp. Args: time_utc_str (str): String representation of the time, with the format: `'%Y-%m-%dT%H:%M:%S %Z'`. Returns: int: Unix timestamp. """ dt = datetime.strptime(time_utc_str, TIME_FORMAT)... |
def list_perceel_adapter(obj, request): """ Adapter for rendering a list of :class: `crabpy.gateway.capakey.Perceel` to json. """ return { 'id': obj.id, 'sectie': obj.sectie, 'capakey': obj.capakey, 'percid': obj.percid } |
def item_gemeente_adapter(obj, request): """ Adapter for rendering an object of :class: `crabpy.gateway.capakey.Gemeente` to json. """ return { 'id': obj.id, 'naam': obj.naam, 'centroid': obj.centroid, 'bounding_box': obj.bounding_box } |
def item_afdeling_adapter(obj, request): """ Adapter for rendering an object of :class: `crabpy.gateway.capakey.Afdeling` to json. """ return { 'id': obj.id, 'naam': obj.naam, 'gemeente': { 'id': obj.gemeente.id, 'naam': obj.gemeente.naam }, 'centroid': obj.centroid, 'bounding_box': obj.bounding_box } |
def item_sectie_adapter(obj, request): """ Adapter for rendering an object of :class: `crabpy.gateway.capakey.Sectie` to json. """ return { 'id': obj.id, 'afdeling': { 'id': obj.afdeling.id, 'naam': obj.afdeling.naam, 'gemeente': { 'id': obj.afdeling.gemeente.id, 'naam': obj.afdeling.gemeente.naam }, }, 'centroid': obj... |
def item_perceel_adapter(obj, request): """ Adapter for rendering an object of :class: `crabpy.gateway.capakey.Perceel` to json. """ return { 'id': obj.id, 'sectie': { 'id': obj.sectie.id, 'afdeling': { 'id': obj.sectie.afdeling.id, 'naam': obj.sectie.afdeling.naam, 'gemeente': { 'id': obj.sectie.afdeling.gemeente.id, ... |
def in1d_events(ar1, ar2): """ Does the same than np.in1d but uses the fact that ar1 and ar2 are sorted and the c++ library. Is therefore much much faster. """ ar1 = np.ascontiguousarray(ar1) # change memory alignement for c++ library ar2 = np.ascontiguousarray(ar2) # change memory alignement for c++ library tmp = np.e... |
def get_max_events_in_both_arrays(events_one, events_two): """ Calculates the maximum count of events that exist in both arrays. """ events_one = np.ascontiguousarray(events_one) # change memory alignement for c++ library events_two = np.ascontiguousarray(events_two) # change memory alignement for c++ library event_res... |
def map_cluster(events, cluster): """ Maps the cluster hits on events. Not existing hits in events have all values set to 0 """ cluster = np.ascontiguousarray(cluster) events = np.ascontiguousarray(events) mapped_cluster = np.zeros((events.shape[0], ), dtype=dtype_from_descr(data_struct.ClusterInfoTable)) mapped_cluste... |
def get_events_in_both_arrays(events_one, events_two): """ Calculates the events that exist in both arrays. """ events_one = np.ascontiguousarray(events_one) # change memory alignement for c++ library events_two = np.ascontiguousarray(events_two) # change memory alignement for c++ library event_result = np.empty_like(e... |
def hist_1d_index(x, shape): """ Fast 1d histogram of 1D indices with C++ inner loop optimization. Is more than 2 orders faster than np.histogram(). The indices are given in coordinates and have to fit into a histogram of the dimensions shape. Parameters ---------- x : array like shape : tuple tuple with x dimensions: ... |
def hist_2d_index(x, y, shape): """ Fast 2d histogram of 2D indices with C++ inner loop optimization. Is more than 2 orders faster than np.histogram2d(). The indices are given in x, y coordinates and have to fit into a histogram of the dimensions shape. Parameters ---------- x : array like y : array like shape : tuple ... |
def hist_3d_index(x, y, z, shape): """ Fast 3d histogram of 3D indices with C++ inner loop optimization. Is more than 2 orders faster than np.histogramdd(). The indices are given in x, y, z coordinates and have to fit into a histogram of the dimensions shape. Parameters ---------- x : array like y : array like z : arra... |
def get_n_cluster_in_events(event_numbers): '''Calculates the number of cluster in every given event. An external C++ library is used since there is no sufficient solution in python possible. Because of np.bincount # BUG #225 for values > int32 and the different handling under 32/64 bit operating systems. Parameters --... |
def import_class(import_path, name=None): """ Imports and returns class for full class path string. Ex. 'foo.bar.Bogus' -> <class 'foo.bar.Bogus'> """ if not name: import_path, name = import_path.rsplit('.', 1) mod = import_module(import_path) try: return getattr(mod, name) except AttributeError as e: raise ImportError... |
def substitute_all(sp_object, pairs): """ Performs multiple substitutions in an expression :param expr: a sympy matrix or expression :param pairs: a list of pairs (a,b) where each a_i is to be substituted with b_i :return: the substituted expression """ if not isinstance(pairs, dict): dict_pairs = dict(pairs) else: dic... |
def quick_solve(expr, var): r""" A function that tries to solve a very simple equation in the quickest way. For instance, an expression like :math: `2*a + 3*b + c == 0` needed to be solved for :math: `c` may be simply solved by stating :math: `c = -(2*a + 3*b)`. The function checks if the right hand side does not conta... |
on the --slow-- `solve()` if we failed if var in res.args: return sympy.solve(expr, var) return res |
def to_sympy_matrix(value): """ Converts value to a `sympy.Matrix` object, if possible. Leaves the value as `sympy.Matrix` if it already was :param value: value to convert :return: :rtype: `sympy.Matrix` """ if isinstance(value, sympy.Matrix): return value try: return sympy.Matrix(value) except ValueError as original_e... |
def to_sympy_column_matrix(matrix): """ Converts a sympy matrix to a column matrix (i.e. transposes it if it was row matrix) Raises ValueError if matrix provided is not a vector :param matrix: a vector to be converted to column :return: """ matrix = to_sympy_matrix(matrix) if matrix.cols == 1: return matrix elif matrix... |
def sympy_expressions_equal(expr1, expr2): """ Compare two sympy expressions that are not necessarily expanded. :param expr1: a first expression :param expr2: a second expression :return: True if the expressions are similar, False otherwise """ # the simplified difference is equal to zero: same expressions try: differe... |
def assert_sympy_expressions_equal(expr1, expr2): """ Raises `AssertionError` if `expr1` is not equal to `expr2`. :param expr1: first expression :param expr2: second expression :return: None """ if not sympy_expressions_equal(expr1, expr2): raise AssertionError("{0!r} != {1!r}".format(expr1, expr2)) |
def _sympy_matrices_equal(matrix_left, matrix_right): """ Compare two sympy matrices that are not necessarily expanded. Calls `deep_compare_expressions` for each element in the matrices. Private function. Use `sympy_expressions_equal`. The former should be able to compare everything. :param matrix_left: :param matrix_r... |
def _eval_res_equal(expr1, expr2, atoms, vals,threshold=10e-10): """ Compare two expressions after evaluation of symbols by random expressions private function called by `sympy_empirical_equal` :param expr1: a first sympy expression :param expr2: a second sympy expression :param atoms: the component symbols (they are a... |
def sympy_empirical_equal(expr1, expr2): """ Compare long , complex, expressions by replacing all symbols by a set of arbitrary expressions :param expr1: first expression :param expr2: second expression :return: True if expressions are empirically equal, false otherwise """ atoms_1 = expr1.atoms() atoms_1 = [a for a in... |
True |
def is_absolute(self): """ Validates that uri contains all parts except version """ return self.namespace and self.ext and self.scheme and self.path |
def _round( cls, quotient, divisor, remainder, base, method=RoundingMethods.ROUND_DOWN ): """ Round the quotient. :param quotient: current quotient :type quotient: list of int :param int divisor: the divisor :param int remainder: the remainder :param int base: the base :param method: the rounding method :raises BasesVa... |
1, base) return (carry, quotient, [], 1) remainder = fractions.Fraction(remainder, divisor) middle = fractions.Fraction(base, 2) if remainder < middle: return (0, quotient, [], -1) if remainder > middle: (carry, quotient) = Nats.carry_in(quotient, 1, base) return (carry, quotient, [], 1) if method is RoundingMethods.RO... |
def _divide(divisor, remainder, quotient, remainders, base, precision=None): """ Given a divisor and dividend, continue until precision in is reached. :param int divisor: the divisor :param int remainder: the remainder :param int base: the base :param precision: maximum number of fractional digits to compute :type prec... |
def _fractional_division( cls, divisor, remainder, base, precision=None, method=RoundingMethods.ROUND_DOWN ): """ Get the repeating and non-repeating part. :param int divisor: the divisor :param int remainder: the remainder :param int base: the base :param precision: maximum number of fractional digits :type precision:... |
cls._round( quotient, divisor, remainder, base, method ) |
def _division(divisor, dividend, remainder, base): """ Get the quotient and remainder :param int divisor: the divisor :param dividend: the divident :type dividend: sequence of int :param int remainder: initial remainder :param int base: the base :returns: quotient and remainder :rtype: tuple of (list of int) * int Comp... |
def division( cls, divisor, dividend, base, precision=None, method=RoundingMethods.ROUND_DOWN ): """ Division of natural numbers. :param divisor: the divisor :type divisor: list of int :param dividend: the dividend :type dividend: list of int :param precision: maximum number of fractional digits :type precision: int or... |
and precision < 0: raise BasesValueError(precision, "precision", "must be at least 0") if any(x < 0 or x >= base for x in divisor): raise BasesValueError( divisor, "divisor", "for all elements, e, 0 <= e < base required" ) if any(x < 0 or x >= base for x in dividend): raise BasesValueError( divisor, "divisor", "for all... |
def undivision( cls, integer_part, non_repeating_part, repeating_part, base ): """ Find divisor and dividend that yield component parts. :param integer_part: the integer part :type integer_part: list of int :param non_repeating_part: the non_repeating_part :type non_repeating_part: list of int :param repeating_part: th... |
non_repeating_part, "non_repeating_part", "for all elements, e, 0 <= e < base required" ) if any(x < 0 or x >= base for x in repeating_part): raise BasesValueError( repeating_part, "repeating_part", "for all elements, e, 0 <= e < base required" ) shift_length = len(repeating_part) frac_length = len(non_repeating_part) ... |
def get_catalog_lookup_session(self): """Gets the catalog lookup session. return: (osid.cataloging.CatalogLookupSession) - a ``CatalogLookupSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_catalog_lookup()`` is ``false`` *compliance: optional -- This method must be impleme... |
def get_catalog_query_session(self): """Gets the catalog query session. return: (osid.cataloging.CatalogQuerySession) - a ``CatalogQuerySession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_catalog_query()`` is ``false`` *compliance: optional -- This method must be implemented ... |
def get_catalog_admin_session(self, proxy): """Gets the catalog administrative session for creating, updating and deleting catalogs. arg: proxy (osid.proxy.Proxy): a proxy return: (osid.cataloging.CatalogAdminSession) - a ``CatalogAdminSession`` raise: NullArgument - ``proxy`` is ``null`` raise: OperationFailed - unabl... |
def get_catalog_hierarchy_session(self, proxy): """Gets the catalog hierarchy traversal session. arg: proxy (osid.proxy.Proxy): proxy return: (osid.cataloging.CatalogHierarchySession) - a ``CatalogHierarchySession`` raise: NullArgument - ``proxy`` is null raise: OperationFailed - unable to complete request raise: Unimp... |
def get_catalog_hierarchy_design_session(self, proxy): """Gets the catalog hierarchy design session. arg: proxy (osid.proxy.Proxy): proxy return: (osid.cataloging.CatalogHierarchyDesignSession) - a ``CatalogHierarchyDesignSession`` raise: NullArgument - ``proxy`` is null raise: OperationFailed - unable to complete requ... |
def get_edxml_with_aws_urls(self): """stub""" edxml = self.get_text().text soup = BeautifulSoup(edxml, 'xml').find('html') if soup is None: soup = BeautifulSoup('', 'xml') soup.append(BeautifulSoup(edxml, 'html5lib')) attrs = { 'draggable': ['icon'], 'drag_and_drop_input': ['img'], 'files': ['included_files'], 'img': [... |
def _init_map(self): """stub""" super(edXAssetContentFormRecord, self)._init_map() AssetContentTextFormRecord._init_map(self) FilesFormRecord._init_map(self) ProvenanceFormRecord._init_map(self) |
def _init_metadata(self): """stub""" super(edXAssetContentFormRecord, self)._init_metadata() AssetContentTextFormRecord._init_metadata(self) FilesFormRecord._init_metadata(self) ProvenanceFormRecord._init_metadata(self) |
def clone_to(self, target_repo): """stub""" new_asset = target_repo.duplicate_asset(self.my_osid_object.ident) form = target_repo.get_asset_form_for_update(new_asset.ident) form.set_provenance(str(self.my_osid_object.ident)) return target_repo.update_asset(form) |
def regenerate_prefixes(self, *args): """Regenerate the cache of command prefixes based on nick etc.""" nick = self.controller.client.user.nick self.prefixes = set([ nick + ": ", nick + ", ", nick + " - ", ]) # Include lower-case versions as well, but not caps self.prefixes.update([p.lower() for p in self.prefixes]) if... |
def check_for_interest(self, client, recipient, message): """Determine whether this line is addressing us.""" for prefix in self.prefixes: if message.startswith(prefix): return True, message[len(prefix):] # Don't require a prefix if addressed in PM. # This comes after the prefix checks because # if the user does includ... |
def parse_command(self, string): """Parse out any possible valid command from an input string.""" possible_command, _, rest = string.partition(" ") # Commands are case-insensitive, stored as lowercase possible_command = possible_command.lower() if possible_command not in self.commands: return None, None event = self.co... |
def waveform_image(mediafile, xy_size, outdir=None, center_color=None, outer_color=None, bg_color=None): """ Create waveform image from audio data. Return path to created image file. """ try: import waveform except ImportError, exc: raise ImportError("%s [get it at https://github.com/superjoe30/PyWaveform]" % exc) outd... |
def waveform_stack(mediafiles, xy_size, output=None, label_style=None, center_color=None, outer_color=None, bg_color=None): """ Create a stack of waveform images from audio data. Return path to created image file. """ img_files = [] output = output or os.path.abspath(os.path.dirname(os.path.commonprefix(mediafiles))) i... |
def _main(): """ Command line interface for testing. """ if len(sys.argv) <= 1: print("Usage: python -m auvyon.imaging.waveforms <mediafile>...") else: try: print("Created %s" % waveform_stack(sys.argv[1:], (640, 48))) except subprocess.CalledProcessError, exc: print("Conversion error: %s" % exc) |
def mangle(tree, toplevel=False): """Mangle names. Args: toplevel: defaults to False. Defines if global scope should be mangled or not. """ sym_table = SymbolTable() visitor = ScopeTreeVisitor(sym_table) visitor.visit(tree) fill_scope_references(tree) mangle_scope_tree(sym_table.globals, toplevel) mangler = NameMangler... |
def _get_string_match_value(self, string, string_match_type): """Gets the match value""" if string_match_type == Type(**get_type_data('EXACT')): return string elif string_match_type == Type(**get_type_data('IGNORECASE')): return re.compile('^' + string, re.I) elif string_match_type == Type(**get_type_data('WORD')): ret... |
def _add_match(self, match_key, match_value, match): """Adds a match key/value""" if match_key is None: raise NullArgument() if match is None: match = True if match: inin = '$in' else: inin = '$nin' if match_key in self._query_terms: if inin in self._query_terms[match_key]: self._query_terms[match_key][inin].append(mat... |
def _match_display_text(self, element_key, string, string_match_type, match): """Matches a display text value""" if string is None or string_match_type is None: raise NullArgument() match_value = self._get_string_match_value(string, string_match_type) self._add_match(element_key + '.text', match_value, match) |
def _match_minimum_decimal(self, match_key, decimal_value, match): """Matches a minimum decimal value""" if decimal_value is None: raise NullArgument() if match is None: match = True if match: gtelt = '$gte' else: gtelt = '$lt' if match_key in self._query_terms: self._query_terms[match_key][gtelt] = decimal_value else:... |
def _match_maximum_decimal(self, match_key, decimal_value, match): """Matches a minimum decimal value""" if decimal_value is None: raise NullArgument() if match is None: match = True if match: ltegt = '$lte' else: ltegt = '$gt' if match_key in self._query_terms: self._query_terms[match_key][ltegt] = decimal_value else:... |
def _filter_settings(settings, prefix): """ Filter all settings to only return settings that start with a certain prefix. :param dict settings: A settings dictionary. :param str prefix: A prefix. """ ret = {} for skey in settings.keys(): if skey.startswith(prefix): key = skey[len(prefix):] ret[key] = settings[skey] ret... |
def get_capakey(registry): """ Get the Capakey Gateway :rtype: :class:`crabpy.gateway.capakey.CapakeyRestGateway` """ # argument might be a config or a request regis = getattr(registry, 'registry', None) if regis is None: regis = registry return regis.queryUtility(ICapakey) |
def get_crab(registry): """ Get the Crab Gateway :rtype: :class:`crabpy.gateway.crab.CrabGateway` # argument might be a config or a request """ # argument might be a config or a request regis = getattr(registry, 'registry', None) if regis is None: regis = registry return regis.queryUtility(ICrab) |
def add_route(config, name, pattern, *args, **kwargs): """ Adds a pyramid route to the config. All args and kwargs will be passed on to config.add_route. This exists so the default behaviour of including crabpy will still be to cache all crabpy routes. """ config.add_route(name, pattern, *args, **kwargs) GENERATE_ETAG_... |
def conditional_http_tween_factory(handler, registry): """ Tween that adds ETag headers and tells Pyramid to enable conditional responses where appropriate. """ settings = registry.settings if hasattr(registry, 'settings') else {} if 'generate_etag_for.list' in settings: route_names = settings.get('generate_etag_for.li... |
response.md5_etag() return response return conditional_http_tween |
def includeme(config): """ Include `crabpy_pyramid` in this `Pyramid` application. :param pyramid.config.Configurator config: A Pyramid configurator. """ settings = _parse_settings(config.registry.settings) base_settings = _get_proxy_settings(settings) # http caching tween if not settings.get('etag_tween_disabled', Fal... |
def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ config = Configurator(settings=settings) includeme(config) return config.make_wsgi_app() |
def get_assessment_parts(self): """Gets the ``AssessmentPartList`` resulting from a search. return: (osid.assessment.authoring.AssessmentPartList) - the assessment part list raise: IllegalState - list has already been retrieved *compliance: mandatory -- This method must be implemented.* """ if self.retrieved: raise err... |
def get_sequence_rules(self): """Gets the ``SequenceRuleList`` resulting from a search. return: (osid.assessment.authoring.SequenceRuleList) - the sequence rule list raise: IllegalState - list has already been retrieved *compliance: mandatory -- This method must be implemented.* """ if self.retrieved: raise errors.Ille... |
def plot_distance_landscape_projection(self, x_axis, y_axis, ax=None, *args, **kwargs): """ Plots the distance landscape jointly-generated from all the results :param x_axis: symbol to plot on x axis :param y_axis: symbol to plot on y axis :param ax: axis object to plot onto :param args: arguments to pass to :func:`mat... |
def plot_trajectory_projection(self, x_axis, y_axis, *args, **kwargs): """ Plots trajectory projection on the specified x and y axes See :meth:`InferenceResult.plot_trajectory_projection()` for information on the arguments and keyword arguments :param x_axis: variable to be plotted on the x axis of the projection :para... |
def distance_landscape_as_3d_data(self, x_axis, y_axis): """ Returns the distance landscape as three-dimensional data for the specified projection. :param x_axis: variable to be plotted on the x axis of projection :param y_axis: variable to be plotted on the y axis of projection :return: a 3-tuple (x, y, z) where x and... |
def plot_distance_landscape_projection(self, x_axis, y_axis, ax=None, *args, **kwargs): """ Plots the projection of distance landscape (if it was returned), onto the parameters specified :param x_axis: symbol to plot on x axis :param y_axis: symbol to plot on y axis :param ax: axis object to plot onto :param args: argu... |
def solutions_as_2d_trajectories(self, x_axis, y_axis): """ Returns the :attr:`InferenceResult.solutions` as a plottable 2d trajectory. :param x_axis: the variable to be on the x axis of projection :param y_axis: the variable to be on the y axis of preojection :return: a tuple x, y specifying lists of x and y coordinat... |
def plot_trajectory_projection(self, x_axis, y_axis, legend=False, ax=None, start_and_end_locations_only=False, start_marker='bo', end_marker='rx', *args, **kwargs): """ Plots the projection of the trajectory through the parameter space the minimisation algorithm took. Since parameter space is often high-dimensional an... |
start and end parameter :param start_marker: The marker to use for start of trajectory, defaults to blue circle :param end_marker: The marker to use for end of trajectory, defaults to red x :param args: Arguments to pass to :func:`matplotlib.pyplot.plot` function :param kwargs: Keyword arguments to pass to :func:`matpl... |
def plot(self, plot_intermediate_solutions=True, plot_observed_data=True, plot_starting_trajectory=True, plot_optimal_trajectory=True, filter_plots_function=None, legend=True, kwargs_observed_data=None, kwargs_starting_trajectories=None, kwargs_optimal_trajectories=None, kwargs_intermediate_trajectories=None): """ Plot... |
filter_plots_function is None: filter_plots_function = lambda x: True observed_trajectories = self.observed_trajectories starting_trajectories = self.starting_trajectories optimal_trajectories = self.optimal_trajectories if plot_intermediate_solutions: intermediate_trajectories_list = self.intermediate_trajectories els... |
list_ = trajectories_by_description[trajectory.description] except KeyError: list_ = [] trajectories_by_description[trajectory.description] = list_ list_.append((trajectory, kwargs_starting_trajectories)) seen_intermediate_trajectories = set() for i, intermediate_trajectories in enumerate(intermediate_trajectories_list... |
def get_type_data(name): """Return dictionary representation of type. Can be used to initialize primordium.type.primitives.Type """ name = name.upper() try: return { 'authority': 'birdland.mit.edu', 'namespace': 'coordinate format', 'identifier': name, 'domain': 'Coordinate Format Types', 'display_name': JEFFS_COORDINA... |
def get_next_type(self): """Gets the next ``Type`` in this list. return: (osid.type.Type) - the next ``Type`` in this list. The ``has_next()`` method should be used to test that a next ``Type`` is available before calling this method. raise: IllegalState - no more elements available in this list raise: OperationFailed ... |
def get_next_types(self, n=None): """Gets the next set of ``Types`` in this list. The specified amount must be less than or equal to the return from ``available()``. arg: n (cardinal): the number of ``Type`` elements requested which must be less than or equal to ``available()`` return: (osid.type.Type) - an array of ``... |
0 while x < n: try: next_list.append(self.next()) except: # Need to specify exceptions here raise OperationFailed() x = x + 1 return next_list |
def get_short_reads(vals): (args,txome,seed,chunk) = vals #fast forward some ammount """Emit the short reads first""" txe = TranscriptomeEmitter(txome,TranscriptomeEmitter.Options(seed=seed)) if args.weights: weights = {} if args.weights[-3:]=='.gz': inf = gzip.open(args.weights) else: inf = open(args.weights) for line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.