optiwindnet.db¶
Submodules¶
Package Contents¶
- optiwindnet.db.open_database(filepath: str, create_db: bool = False) peewee.SqliteDatabase[source]¶
Opens the sqlite database v3 file specified in filepath.
- Parameters:
filepath – path to database file
create_db – True -> create a new file if it does not exist
- Returns:
SqliteDatabase object (Peewee)
- class optiwindnet.db.Method(*args, **kwargs)[source]¶
Bases:
BaseModel- digest¶
- solver_name¶
- funname¶
- options¶
- timestamp¶
- funfile¶
- funhash¶
- class optiwindnet.db.NodeSet(*args, **kwargs)[source]¶
Bases:
BaseModel- digest¶
- name¶
- T¶
- R¶
- B¶
- VertexC¶
- constraint_groups¶
- constraint_vertices¶
- landscape_angle¶
- class optiwindnet.db.RouteSet(*args, **kwargs)[source]¶
Bases:
BaseModel- id¶
- handle¶
- valid¶
- T¶
- R¶
- capacity¶
- length¶
- is_normalized¶
- runtime¶
- num_gates¶
- C¶
- D¶
- creator¶
- detextra¶
- num_diagonals¶
- tentative¶
- rogue¶
- timestamp¶
- misc¶
- stuntC¶
- clone2prime¶
- edges¶
- nodes¶
- method¶
- machine¶
- optiwindnet.db.G_by_method(G: networkx.Graph, method: object) networkx.Graph[source]¶
Fetch from the database a layout for G by method. G must be a layout solution with the necessary info in the G.graph dict. method is a Method.
- optiwindnet.db.G_from_routeset(routeset: object) networkx.Graph[source]¶
Translate a RouteSet database entry to a routeset graph.
- Parameters:
routeset – an entry from the database RouteSet table.
- Returns:
Graph G containing the routeset.
- optiwindnet.db.Gs_from_attrs(farm: object, methods: object | collections.abc.Sequence[object], capacities: int | collections.abc.Sequence[int]) list[tuple[networkx.Graph]][source]¶
Fetch from the database a list (one per capacity) of tuples (one per method) of layouts. farm must have the desired NodeSet name in the name attribute. methods is a (sequence of) Method instance(s). capacities is a (sequence of) int(s).