rex.utilities.utilities
Collection of helpful functions
Functions
Check an eval() string for questionable code. |
|
|
Check resource to see if the given path - It belongs to a multi-file handler - Is on local disk - Is a hsds path |
|
Check datetime index for timezone, if None set to UTC |
|
Load jsonified string entries into dictionaries using JSON |
|
extract timestamp from file name |
|
Create list of chunk slices [(s_i, e_i), ...] |
|
Get all class properties Used to check against config keys |
|
Get column dtype for converstion to records array |
|
Get columns that contain (latitude, longitude) coordinates |
|
Jsonify a dictionary into a string with handling for int/float keys. |
|
Calc the annual irradiance at a site given an irradiance timeseries. |
Parse data parameters from an integer or string of format YYYYMMDD |
|
|
Load pandas DataFrame from .csv or .json file or dictionary |
|
extract timestamp with given format from given path |
|
Attempt to parse a year out of a string. |
|
A simple wrapper on the pd.date_range() method that handles the closed vs. |
|
Distance threshold for nearest neighbor searches performed on resource points. |
|
Roll timeseries from UTC to local time. |
|
Convert supply curve point gids to row and col indices given row length |
|
Perform a json file load with better exception handling. |
|
Perform a yaml file load with better exception handling. |
|
Slice sites into given number of sub-sets with given number of chunks per sub-set |
|
Split sites into sub-lists of ~ size slice_size |
|
Break up sites_slice into slices of size slice_size |
|
Convert a date string of format YYYYMMDD to date object. |
Convert a date string of format YYYYMMDD to datetime object. |
|
|
convert time stamp format to redex |
|
Convert pandas DataFrame to numpy Records Array |
|
Utility to create sensical os agnostic paths from relative or local path such as: - ~/file - file - /. |
|
Validate an input filepath. |
|
Write data to given json file |
Classes
|
Retry Decorator to run a function multiple times |