iode.Identities

class iode.Identities(filepath: str = None)[source]

IODE Identities database.

Parameters:
filepath: str, optional

file containing the IODE identities to load.

Attributes:
filename: str
description: str

Methods

clear()

Delete all objects from the current database.

compare(filepath[, ...])

The objects of the current database are compared with those stored in the file filepath.

copy([pattern])

Create a new database instance in which each object is a copy of the original object from the global IODE database.

copy_from(input_files[, names])

Copy (a subset of) identities from the input file(s) 'input_files' into the current database.

execute([identities, from_period, ...])

Execute the specified identity(ies).

from_series(s)

Copy the pandas Series s into the IODE Identities database.

get_name(pos)

Return the name of the IODE object at position pos in the database.

get_names([pattern, filepath])

Returns the list of objects names given a pattern.

get_names_from_pattern(list_name, pattern, xdim)

Generate an IODE list containing the names of objects that match a given pattern.

index(name)

Return the position of the IODE object with name name in the database.

load(filepath)

Load objects stored in file 'filepath' into the current database.

merge(other[, overwrite])

Merge the content of the 'other' database into the current database.

merge_from(input_file)

Merge all objects stored in the input file 'input_file' into the current database.

new_detached()

Create a new empty detached database.

print_to_file(filepath[, names, format])

Print the list identities defined by names to the file filepath using the format format.

remove(names)

Delete the object(s) named 'names' from the current database.

rename(old_name, new_name[, overwrite])

Rename an object of the database.

save(filepath[, compress])

Save objects of the current database into the file 'filepath'.

search(pattern[, word, case_sensitive, ...])

Return a list of all objects from the current database having a specific pattern in their names or LEC expression, comment...

subset(pattern, copy)

Create a subset of the database filtered by a name pattern.

to_series()

Create a pandas Series from the current Identities database.

from_cython_obj

get_instance

Returns:
Identities

Examples

>>> from iode import identities, SAMPLE_DATA_DIR
>>> identities.load(f"{SAMPLE_DATA_DIR}/fun.idt")
Loading .../fun.idt
48 objects loaded 
>>> len(identities)
48
>>> identities
Workspace: Identities
nb identities: 48
filename: ...\tests\data\fun.idt

 name                                                   identities
AOUC        ((WCRH/QL)/(WCRH/QL)[1990Y1])*(VAFF/(VM+VAFF))[-1]+PM*(VM/(VM+VAFF))[-1]
AOUC_       exp(ln(((WCF/NFYH)/QL)+PKF/(QAFF/KNFFY))*(QAFF/(QX+QAFF)+.05)[-1]+ln PM*(QM/ (QAFF+QM)-0.05)[-1])
FLGR        FLG/VBBP
GAP2        100*(QAFF_/(Q_F+Q_I))
GAP_        100*((QAF_/Q_F)-1)
...         ...
XTFP        grt TFPFHP_
XW          0
Y           QBBP_P
YSEFPR      YSEFP/WBGP
YSFICR      YSFIC/(TWGP*ZJ)
__init__(filepath: str = None)[source]

Methods

__init__([filepath])

clear()

Delete all objects from the current database.

compare(filepath[, ...])

The objects of the current database are compared with those stored in the file filepath.

copy([pattern])

Create a new database instance in which each object is a copy of the original object from the global IODE database.

copy_from(input_files[, names])

Copy (a subset of) identities from the input file(s) 'input_files' into the current database.

execute([identities, from_period, ...])

Execute the specified identity(ies).

from_cython_obj(obj)

from_series(s)

Copy the pandas Series s into the IODE Identities database.

get_instance()

get_name(pos)

Return the name of the IODE object at position pos in the database.

get_names([pattern, filepath])

Returns the list of objects names given a pattern.

get_names_from_pattern(list_name, pattern, xdim)

Generate an IODE list containing the names of objects that match a given pattern.

index(name)

Return the position of the IODE object with name name in the database.

load(filepath)

Load objects stored in file 'filepath' into the current database.

merge(other[, overwrite])

Merge the content of the 'other' database into the current database.

merge_from(input_file)

Merge all objects stored in the input file 'input_file' into the current database.

new_detached()

Create a new empty detached database.

print_to_file(filepath[, names, format])

Print the list identities defined by names to the file filepath using the format format.

remove(names)

Delete the object(s) named 'names' from the current database.

rename(old_name, new_name[, overwrite])

Rename an object of the database.

save(filepath[, compress])

Save objects of the current database into the file 'filepath'.

search(pattern[, word, case_sensitive, ...])

Return a list of all objects from the current database having a specific pattern in their names or LEC expression, comment...

subset(pattern, copy)

Create a subset of the database filtered by a name pattern.

to_series()

Create a pandas Series from the current Identities database.

Attributes

coefficients

Return the list of coefficients (scalars) used in the identities of (the subset of) the database.

description

Description of the current database.

filename

Return the filepath associated with the current database.

i

Allow to select the ith identity in the database.

iode_type

Return the object type of the current database.

is_detached

Whether or not any change made on the present database or subset will modify the global IODE workspace.

is_global_workspace

Whether or not the present database represents the global IODE workspace.

names

List of names of all objects in the current database.

series

Create a pandas Series from the current Identities database.

variables

Return the list of variables used in the identities of (the subset of) the database.