omegalpes.general package

Subpackages

Submodules

omegalpes.general.time module

This module creates the Time object

class omegalpes.general.time.TimeUnit(start='01/01/2018', end=None, periods=None, dt=1, verbose=True)[source]

Bases: object

Description

Class defining the studied time period.

Attributes

  • DATES : dated list of simulation steps

  • DT : delta t between values in hours (int or float), i.e. 1/6 will be 10 minutes.

  • LEN : number of simulation steps (length of DATES)

  • I : index of time ([0 : LEN])

get_date_for_index(index)[source]

Getting a date for a given index

Parameters:

index – int value for the index of the wanted dated, between 0 and LEN (it must be in the studied period)

property get_days

Getting days for the studied period

Return all_days:

list of days of the studied period

get_index_for_date(date='YYYY-MM-DD HH:MM:SS')[source]

Getting the index associated with a date

Parameters:

date – date the index of is wanted. Format YYYY-MM-DD HH:MM:SS, must be within the studied period and consistent with the timestep value

get_index_for_date_range(starting_date='YYYY-MM-DD HH:MM:SS', end=None, periods=None)[source]

Getting a list of index for a date range

Parameters:
  • starting_date – starting date of the wanted index

  • end – ending date of the wanted index

  • periods – number of periods from the starting_date of the wanted index

Return index_list:

list of indexes for the given dates

get_non_working_dates(month_range=range(0, 12), hour_range=range(0, 24), country='France')[source]
get_non_working_days(country='France')[source]
get_working_dates(month_range=range(0, 12), hour_range=range(0, 24), country='France')[source]
get_working_days(country='France')[source]
print_studied_period()[source]
omegalpes.general.time.convert_european_format(date)[source]

Converting a date with an european format DD/MM/YYYY into a datetime format YYYY-MM-DD or return

Parameters:

date – date in european format

Returns:

date in format datetime

Module contents