Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
antares_xpansion.input_checker Namespace Reference

Classes

class  BatchSizeValueError
 
class  CandidateFileWrongTypeValue
 
class  CandidateLinkWithoutSeparator
 
class  CandidateNameDuplicatedError
 
class  EmptyCandidateLink
 
class  EmptyCandidateName
 
class  ExpertLogsValueError
 
class  GapValueError
 
class  IllegalCharsInCandidateName
 
class  LogLevelValueError
 
class  MaxIterValueError
 
class  MaxUnitsAndMaxInvestmentAreNullSimultaneously
 
class  MaxUnitsAndMaxInvestmentNonNullSimultaneously
 
class  NotHandledOption
 Checks related to settings.ini. More...
 
class  NotHandledValue
 
class  OptionTypeError
 
class  ProfileFileNegativeValue
 
class  ProfileFileNotExists
 
class  ProfileFileValueError
 
class  ProfileFileWrongNumberOfcolumns
 
class  ProfileFileWrongNumberOfLines
 
class  SeparationParameterValueError
 
class  TimelimitValueError
 
class  UnrecognizedCandidateOptionType
 Checks related to candidates.ini. More...
 

Functions

 _check_profile_file_consistency (filename_path)
 
 _check_profile_file (filename_path)
 
 _check_candidate_option_type (option, value)
 
 _check_candidate_name (name, section)
 
 _verify_name_has_no_invalid_character (name, section)
 
 _verify_name_is_not_empty (name, section)
 
 _check_candidate_link (link, section)
 
 _check_candidate_attributes (ini_file)
 
 _check_name_is_unique (ini_file)
 
 _check_candidate_name_and_link (ini_file)
 
 _check_candidate_exclusive_attributes (ini_file)
 
 _copy_in_backup (ini_file, candidates_ini_filepath)
 
 _check_attribute_profile_values (ini_file, capacity_dir_path)
 
 _check_attributes_profile (ini_file, candidates_ini_filepath, capacity_dir_path)
 
 check_candidates_file (candidates_ini_filepath, capacity_dir_path)
 
 str_to_bool (str my_str)
 
 _check_setting_option_type (option, value)
 
 check_options (options)
 
bool _check_max_iteration (value)
 
bool _check_timelimit (value)
 
bool _check_log_level (value)
 
bool _check_batch_size (value)
 
bool _check_separation (value)
 
 _check_setting_option_value (option, value)
 

Variables

list INFINITY_LIST = ["+Inf", "+infini"]
 
 logger = step_logger(__name__, "input checks")
 
dict candidate_options_type
 
 type_str = str
 
 type_int = int
 
 type_float = float
 
 type_bool = bool
 
dict options_types_and_legal_values
 

Detailed Description

    module to perform checks on antares xpansion input data

Function Documentation

◆ _check_candidate_link()

antares_xpansion.input_checker._check_candidate_link (   link,
  section 
)
protected
checks that the candidate's link is not empty

◆ _check_candidate_name()

antares_xpansion.input_checker._check_candidate_name (   name,
  section 
)
protected
checks that the candidate's name is not empty and does not contain a space

◆ _check_candidate_option_type()

antares_xpansion.input_checker._check_candidate_option_type (   option,
  value 
)
protected
verifies if a given option value has the correct type corresponding allowed for this option

:param option: the treated option
:param value: the value assigned to the option

:return: True if the value has an appropriate type, False or exist otherwise

◆ _check_profile_file()

antares_xpansion.input_checker._check_profile_file (   filename_path)
protected
verifies if a given profile file is valid and indicates if it is a null profile or not

:param filename_path: path to the profile file to check

:return: returns False if the profile is null

◆ _check_setting_option_type()

antares_xpansion.input_checker._check_setting_option_type (   option,
  value 
)
protected
checks that a given option value has the correct type

:param option: name of the option to verify from settings file
:param value: value of the option to verify

:return: True if the option has the correct type,
         False or exits if the value has the wrong type

◆ _check_setting_option_value()

antares_xpansion.input_checker._check_setting_option_value (   option,
  value 
)
protected
checks that an option has a legal value

:param option: name of the option to verify from settings file
:param value: value of the option to verify

:return: True if the option has the correct type, exits if the value has the wrong type

◆ check_options()

antares_xpansion.input_checker.check_options (   options)
checks that a settings file related to an XpansionDriver has the correct format
Exits if the candidates files has the wrong format.

:param options: the options obtained from the settings.ini file

:return:

Variable Documentation

◆ candidate_options_type

dict antares_xpansion.input_checker.candidate_options_type
Initial value:
1= {
2 "name": "string",
3 "link": "string",
4 "annual-cost-per-mw": "non-negative",
5 "unit-size": "non-negative",
6 "max-units": "non-negative",
7 "max-investment": "non-negative",
8 "direct-link-profile": "string",
9 "indirect-link-profile": "string",
10 "already-installed-capacity": "non-negative",
11 "already-installed-direct-link-profile": "string",
12 "already-installed-indirect-link-profile": "string",
13}

◆ options_types_and_legal_values

dict antares_xpansion.input_checker.options_types_and_legal_values
Initial value:
1= {
2 "uc_type": (type_str, ["expansion_accurate", "expansion_fast"]),
3 "master": (type_str, ["relaxed", "integer"]),
4 "optimality_gap": (type_float, None),
5 "relative_gap": (type_float, None),
6 "relaxed_optimality_gap": (type_float, None),
7 "max_iteration": (type_int, None),
8 "solver": (type_str, None),
9 "timelimit": (type_int, None),
10 "yearly-weights": (type_str, None),
11 "additional-constraints": (type_str, None),
12 "log_level": (type_int, ["0", "1", "2", "3"]),
13 "separation_parameter": (type_float, None),
14 "batch_size": (type_int, None),
15}