Skip to content

Commit

Permalink
add get_class_properties to utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
MRossol committed Jul 13, 2020
1 parent f2c99b5 commit 73a5687
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions rex/utilities/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Collection of helpful functions
"""
import datetime
import inspect
import json
import os
import pandas as pd
Expand Down Expand Up @@ -343,3 +344,21 @@ def parse_table(table):
'.json, or pandas.DataFrame'.format(type(table)))

return table


def get_class_properties(cls):
"""
Get all class properties
Used to check against config keys
Returns
-------
properties : list
List of class properties, each of which should represent a valid
config key/entry
"""
properties = [attr for attr, attr_obj
in inspect.getmembers(cls)
if isinstance(attr_obj, property)]

return properties
2 changes: 1 addition & 1 deletion rex/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""rex Version number"""

__version__ = "0.2.1"
__version__ = "0.2.2"

0 comments on commit 73a5687

Please sign in to comment.