Skip to main content

origin_sdk.OriginSession

OriginSession Objects

class OriginSession(APISession)

Manage access to the Origin API.

By default the session will connect to the production Origin API endpoint. This can be overridden by passing the base_url into the constructor or by setting the above environment variables for BASE_URLs. This feature is for internal use only.

The authentication token is read from the user's home directory $home/.aurora-api-key e.g. C:/Users/Joe Bloggs/.aurora-api-key. This can be overridden by passing the token into the constructor or by setting the environment variable AURORA_API_KEY.

Arguments:

  • token string, optional - Override the api authentication token used for API access. Defaults to None.
  • scenario_base_url string, optional - Override the scenario service base url
  • inputs_base_url string, optional - Override the model inputs service base url

get_aurora_scenarios

def get_aurora_scenarios(
region: Optional[str] = None) -> List[ScenarioSummaryType]

Gets a list of all published Aurora scenarios.

Arguments:

region (string, optional) - A regional filter. We accept three letter ISO codes where appropriate. If in doubt as to which code to use for a region (e.g. Iberia), you can check the Origin URL while browsing the platform. You will see something like ".../launcher/aer/<REGION>"

Returns:

List[ScenarioSummaryType]

get_scenario_by_id

def get_scenario_by_id(scenario_id: str) -> ScenarioType

Get a single scenario by it's ID.

Arguments:

scenario_id (string) - The ID of the scenario

Returns:

ScenarioType

create_scenario

def create_scenario(scenario: InputScenario) -> ScenarioType

Creates a new scenario

Arguments:

scenario (InputScenario) -

update_scenario

def update_scenario(scenario_update) -> ScenarioType

delete_scenario

def delete_scenario(scenario_id: str)

launch_scenario

def launch_scenario(scenario_id: str) -> ScenarioType

get_projects

def get_projects() -> List[ProjectSummaryType]

get_project

def get_project(project_id: str) -> ProjectType

create_project

def create_project(project: InputProject) -> ProjectSummaryType

update_project

def update_project(project_update) -> ProjectSummaryType

delete_project

def delete_project(project_id)

pin_project

def pin_project(project_id)

unpin_project

def unpin_project(project_id)

get_meta_json

def get_meta_json(meta_url: str)

get_inputs_session

def get_inputs_session(scenario_id: str) -> InputsSession

Gets the inputs instance information, as well as rehydrating all the data if required

get_model_files

def get_model_files(scenario_id: str) -> Dict[str, Any]

Lists the model files for a scenario, for all runs and years. Each file is represented by a file URL, which maybe used to generate downloadable URLs later. Please note that the files will not be available after the retention period has expired.

This feature is for internal use only.

Arguments:

scenario_id (string) - The Scenario ID of the scenario to get model files for.

get_model_file_download_url

def get_model_file_download_url(file_url: str) -> str

Gets the model file downloadable URL for a given model file url. This feature is for internal use only.

Arguments:

file_url (string) - The model file URL to get the download URL for

get_technology_names

@access_next_data_key_decorator
def get_technology_names(scenario_id: str) -> TechnologyNames

Gets the technology names available for update, by region, and any subtechnology groupings

get_technology

@access_next_data_key_decorator
def get_technology(scenario_id: str,
technology_name: str,
region: str,
subregion: Optional[str] = None,
exogenous_sub_technology: Optional[str] = None,
subsidy: Optional[str] = None,
endogenous_sub_technology: Optional[str] = None)

Gets a specific technology information and all it's yearly and non yearly values available for update

update_technology_endogenous

@access_next_data_key_decorator
def update_technology_endogenous(scenario_id: str,
technology_name: str,
parameter: str,
transform: List[Transform],
region: str,
sub_region: Optional[str] = None,
sub_technology: Optional[str] = None)

Updates an endogenous technology assumption.

update_technology_exogenous

@access_next_data_key_decorator
def update_technology_exogenous(scenario_id: str,
technology_name: str,
parameter: str,
transform: List[Transform],
region: str,
sub_region: Optional[str] = None,
subsidy: Optional[str] = None,
sub_technology: Optional[str] = None)

Updates an exogenous technology assumption.

get_demand_regions

def get_demand_regions(scenario_id: str) -> List[str]

Gets the regions of demand available for the current scenario

get_demand

@access_next_data_key_decorator
def get_demand(scenario_id: str,
demand_filter: Optional[InputsDemandFilter] = None,
aggregate_regions=False) -> List[InputsDemand]

Gets system demand and demand technology assumptions for this scenario

update_system_demand

@access_next_data_key_decorator
def update_system_demand(scenario_id: str,
region: Union[str, List[str]],
variable: str,
transform: List[Transform],
auto_capacity_market_target: Optional[bool] = None)

Updates a system demand parameter for one or more regions. (A system demand parameter is one that appears under variables of the main demand object, and not one of the demand technologies variables).

get_demand_technology_names

@access_next_data_key_decorator
def get_demand_technology_names(
scenario_id: str,
demand_technology_filter: Optional[Any] = None) -> List[InputsDemand]

Gets just demand technology names available, as well as the regions they each belong to.

get_demand_technologies

@access_next_data_key_decorator
def get_demand_technologies(
scenario_id: str,
demand_technology_filter: Optional[Any] = None) -> List[InputsDemand]

Gets just demand technologies, without system demand information.

update_demand_technology_variable

@access_next_data_key_decorator
def update_demand_technology_variable(
scenario_id: str,
region: Union[str, List[str]],
technology: str,
variable: str,
transform: List[Transform],
auto_capacity_market_target: Optional[bool] = None
) -> List[InputsDemand]

Updates a demand technology variable for one or more regions. (A demand technology variable is one that appears on a demand technology object, rather than on the system level demand object).

get_commodities

@access_next_data_key_decorator
def get_commodities(scenario_id: str,
native_units_flag: Optional[bool] = None,
regions: Optional[List[str]] = None,
commodities: Optional[List[str]] = None)

Gets commodities data.

Arguments:

  • scenario_id String - ID of the scenario to get the commodities data from
  • native_units_flag Optional, Boolean - What units should be used on the return data, MWh or the "native units" the commodities come in. Defaults to false.
  • regions Optional, List[String] - If given, will filter the commodity prices to the region specifically. By default, we will perform an equally weighted global average.
  • commodities Optional, List[String] - If given, will filter the commodities to the ones specified. By default, we will query for all commodities.

update_commodity_price

@access_next_data_key_decorator
def update_commodity_price(scenario_id: str,
commodity: str,
regions: List[str],
transform: List[Transform],
native_units_flag: Optional[bool] = None)

Updates a commodity price.

Arguments:

  • scenario_id String - ID of the scenario to get the commodities data from come in. Defaults to false.
  • commodity String - The commodity to update.
  • regions List[String] - The regions to update. You can use the regions array on the "get commodities" return object to inform the view you should update.
  • transform List[Transform] - The transform array used in all updates
  • native_units_flag Optional, Boolean - What units should be used on the return data, MWh or the "native units" the commodities

change_base_commodities_assumptions

@access_next_data_key_decorator
def change_base_commodities_assumptions(scenario_id: str,
rebase_reference_id: str)

Function to change the underlying commodities assumptions. This changes the original values, and then any changes you have made (e.g. +15%) will apply over the top.

get_interconnectors_connections

@access_next_data_key_decorator
def get_interconnectors_connections(scenario_id: str) -> Dict[str, List[str]]

Gets a dictionary of interconnector connections between regions for the given scenario.

Arguments:

  • scenario_id String - ID of the scenario to get the interconnector data from

get_interconnectors

@access_next_data_key_decorator
def get_interconnectors(scenario_id: str, region: str, connection_region: str)

Gets the interconnector data between two regions.

Arguments:

  • scenario_id String - ID of the scenario to get the interconnector data from
  • region String - The region the interconnector is to/from
  • connection_region String - The connected region the interconnector is from/to

update_interconnectors

@access_next_data_key_decorator
def update_interconnectors(scenario_id: str, from_region: str, to_region: str,
variable: str, transform: List[Transform])

Function to update a interconnector variable between two regions.

Arguments:

  • scenario_id String - ID of the scenario to update the interconnector data from
  • from_region String - The region the interconnector is from
  • to_region String - The region the interconnector is to
  • variable String - The variable to update
  • transform List[Transform] - The transform array used in all updates

get_workbook_download_url

@access_next_data_key_decorator
def get_workbook_download_url(scenario_id: str)

Will request the generation of an inputs workbook and then return a URL to download the workbook from once it's ready.

Arguments:

  • scenario_id String - ID of the scenario to get the workbook download URL from

get_weather_year_list

def get_weather_year_list(scenario_id: str)

Provides list of weather years that are supported for this scenario. Returns empty list if weather year feature not supported.

Arguments:

  • scenario_id String - ID of the scenario for which to check for supported weather years