IO
Module functions for working with configuration files.
write_config
Write a configuration file to YAML.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Namespace | dict[str, Any]
|
A Namespace object parsed from argparse. If there are values for |
required |
Source code in src/layopt/io.py
read_yaml
Read a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
Union[str, Path]
|
YAML file to read. |
required |
Returns:
| Type | Description |
|---|---|
Dict
|
Dictionary of the file. |
Source code in src/layopt/io.py
convert_path
get_date_time
Get the current date-time as a string for the systems current timezone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strftime
|
str
|
String for formatting date-time, default is |
'%Y-%m-%d %H:%M:%S'
|
Returns:
| Type | Description |
|---|---|
str
|
Date-time as a string for systems current timezone. |
Source code in src/layopt/io.py
dict_to_df
Convert a dictionary of LayOpt results to Pandas DataFrame.
Typically a set of results is a dictionary with no nesting and the resulting data frame has a single row.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
dict[str, Any]
|
Dictionary to convert to Pandas DataFrame. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Data as a Pandas dictionary. |