Problem Definition Module – cyclopts.problems

This module provides base classes for Problem Families, Species, and Solvers.

author:Matthew Gidden <matthew.gidden _at_ gmail.com>
class cyclopts.problems.ProblemFamily[source]

A class representing families of problems that share the same structure.

read_inst(uuid, tables)[source]

Derived classes must implement this function to return a tuple instance structures that can be provided to the run_inst function.

Parameters:

uuid : uuid

The uuid of the instance to read

tables : list of cyclopts_io.Table

The tables that can be written to

Returns:

inst : tuple or other

A representation of a problem instance

record_inst(inst, inst_uuid, param_uuid, species, tables)[source]

Derived classes must implement this function.

Parameters:

inst : tuple or other

A representation of a problem instance

inst_uuid : uuid

The uuid of the instance

param_uuid : uuid

The uuid of the point in parameter space

species : str

The name of the species that generated this instance

tables : list of cyclopts_io.Table

The tables that can be written to

record_soln(soln, soln_uuid, inst, inst_uuid, tables)[source]

Derived classes must implement this function to return a list of

Parameters:

soln : ProbSolution or similar

A representation of a problem solution

soln_uuid : uuid

The uuid of the solution

inst : tuple or other

A representation of a problem instance

inst_uuid : uuid

The uuid of the instance

tables : list of cyclopts_io.Table

The tables that can be written to

register_tables(h5file, prefix)[source]

Derived classes must implement this function and return their list of tables

Parameters:

h5file : PyTables File

the hdf5 file

prefix : string

the absolute path to the group for tables of this family

Returns:

tables : list of cyclopts_io.Tables

All tables that could be written to by this species.

run_inst(inst, solver)[source]

Derived classes must implement this function to take a tuple instance structures provided by the exec_inst function and return a ProblemResult or similar object.

Parameters:

inst : tuple or other

A representation of a problem instance

solver : ProbSolver or similar

A representation of a problem solver

Returns:

soln : ProbSolution or similar

A representation of a problem solution

name[source]

Derived classes should implement this function, returning the name of the family

Returns:

name : string

The name of this family

property_table_name[source]

Derived classes must implement this function and return the name of the table associated with aggregate instance properties

Returns:

name : string

The name of this family’s instance property table

table_prefix[source]

Returns the HDF5 group location for tables of this family

class cyclopts.problems.ProblemSpecies[source]

A class represnting species of problems that share the same parameter space and ProblemFamiliy.

gen_inst(point)[source]

Derived classes must implement this function, returning a representation of a problem instance.

Parameters:

point : tuple or other

A representation of a point in parameter space

Returns:

inst : tuple or other

A representation of a problem instance to be used by this species’ family

points()[source]

Derived classes must implement this function returning a representation of a point in its parameter space to be used by other class member functions.

Returns:

point_generator : generator

A generator for representation of a point in parameter space to be used by this species

read_space(space_dict)[source]

Derived classes must implement this function.

Parameters:

space_dict : dict

A dictionary container resulting from the reading in of a run control file

record_point(point, param_uuid, tables)[source]

Derived classes must implement this function, recording information about a parameter point in the appropriate tables.

Parameters:

point : tuple or other

A representation of a point in parameter space

param_uuid : uuid

The uuid of the point in parameter space

tables : list of cyclopts_io.Table

The tables that can be written to

register_tables(h5file, prefix)[source]

Derived classes must implement this function and return their list of tables

Parameters:

h5file : PyTables File

the hdf5 file

prefix : string

the absolute path to the group for tables of this species

Returns:

tables : list of cyclopts_io.Tables

All tables that could be written to by this species.

family[source]

Derived classes must implement this function and return and instance of this species’ family

Returns:

family : ProblemFamily or similar

An instance of this species’ family

n_points[source]

Derived classes must implement this function returning the number of points in its parameter space.

Returns:

n : int

The total number of points in the parameter space

name[source]

Derived classes should implement this function, returning the name of the species

Returns:

name : string

The name of this species

table_prefix[source]

Returns the HDF5 group location for tables of this species

This Page