Highlights
1. Support for TM1 v12
TM1py now works with TM1 v12.
with TM1Service(
address="us-east-2.aws.planninganalytics.ibm.com",
api_key="AB4VfG7T8wPM-912uFKeYG5PGh0XbS80MVBAt7SEG6xn",
iam_url="https://iam.cloud.ibm.com/identity/token",
tenant="YA9A2T8BS2ZU",
database="Database") as tm1:
print(tm1.server.get_product_Version())
2. CRUD operations to manage servers on v12
with ManageService(domain=domain, root_client=root_client, root_secret=root_secret) as manager:
manager.create_database(instance_name="instance name",
database_name="database_name",
product_version="12.0.0",
number_replicas=1,
cpu_requests="1000m",
cpu_limits="2000m",
memory_limits="2G",
memory_requests="1G",
storage_size="20Gi")
manager.scale_database(instance_name="instance name", database_name="database name", replicas=2)
manager.create_database_backup(instance_name="instance name",
database_name="database name",
backup_set_name="my backup")
by @rclapp
3. Asynchronous execute_mdx
functions
Speed up your MDX executions by assigning more than one worker-thread in TM1.
mdx = """
SELECT
{TM1SubsetAll([Big Dimension])} ON ROWS,
{TM1SubsetAll([Small Dimension])} ON COLUMNS
FROM [Big Cube]
"""
with TM1Service(**tm1params) as tm1:
cells = tm1.cells.execute_mdx(
mdx=mdx,
# leverage 4 worker threads in TM1 for the extraction
max_workers=4,
# parallelization on rows axis
async_axis=1)
by @vmitsenko in #935 and #1030
4. Hierarchy updates from data frames
Create and update TM1 hierarchies directly from pandas dataframes.
Stores | ElementType | Alias:a | City:s | Square Footage:n | level001 | level000 | level001_weight | level000_weight |
---|---|---|---|---|---|---|---|---|
S151 | Numeric | Boardwalk Games | New York City | 120 | USA | World | 1 | 1 |
S143 | Numeric | Strategy Vault | Zurich | 250 | Switzerland | World | 1 | 1 |
S811 | Numeric | Cardboard Castle | Sydney | 80 | Sydney | World | 1 | 1 |
columns = ["Stores", "ElementType", "Alias:a", "City:s", "Square Footage:n", "level001",
"level000", "level001_weight", "level000_weight"]
data = [
['S151', "Numeric", "Boardwalk Games", "New York City", 120, "USA", "World", 1, 1],
['S143', 'Numeric', "Strategy Vault", "Zurich", 250, "Switzerland", "World", 1, 1],
['S811', 'Numeric', "Cardboard Castle", "Sydney", 80, "Sydney", "World", 1, 1],
]
with TM1Service(**tm1params) as tm1:
tm1.hierarchies.update_or_create_hierarchy_from_dataframe(
dimension_name="Stores",
hierarchy_name="Stores",
df=DataFrame(data=data, columns=columns)
)
by @MariusWirtz in #944 and #1011
New Features, Improvements, and Bugfixes
- Improve
get_elements_dataframe
with optionaluse_blob
by @MariusWirtz in #908 and #1040 - Allow spreading on
write
withuse_blob
&use_ti
by @Kevin-Dekker in #909 - Add
proxies
arg toTM1Service
by @MariusWirtz in #911 - Show parameters on decorated functions in PyCharm by @MariusWirtz in #913
- Cater to breaking change in urllib3 2.0 release by @MariusWirtz in #918
- Fix wrong position brackets in
extract_cellset_raw
by @vmitsenko in #923 - Add
keep_existing_attributes
to dimension update function to fix #922 by @hermie64 in #924 - Enforce non-async request on project PUT to fix #872 by @nicolasbisurgi in #925
- Add
get_edges_under_consolidation
Function by @MariusWirtz in #927, #930 - Add method to delete elements by @Kevin-Dekker in #939
- Avoid failure on attempt to write empty cellset by @rclapp in #947
- Delete multiple elements using TI by @MariusWirtz in #940
- Make JSON parsing for Chore more robust by @MariusWirtz in #950
- Make JSON parsing for NativeView more robust by @MariusWirtz in #955
- Remove temp view in
_execute_view_csv_use_blob
by @MariusWirtz in #959 - Added clear view argument to write_through_blob by @cubewise-gng in #964
- Add
arranged_axes
arg toexecute_view_csv
functions by @MariusWirtz in #961 - Allow optional weight columns on
get_elements_dataframe
function result by @MariusWirtz in #975 - Add new methods to expose cell partitioning by @rclapp in #976
- Allow usage of
get_attribute_of_elements
function with numpy arrays by @MBonotto in #987 - Add search function
search_error_log_filenames
for Process Error Log Filenames by @adscheevel in #1004 - Include
clear_view
arg inwrite_dataframe
by @MariusWirtz in #1012 - Add
replace_element
function to Hierarchy class by @MariusWirtz in #1014 - Add
update_or_create
function in ElementService.py by @yyzz1010 in #1018 - Add
allow_empty_alias
argument toget_elements_dataframe
function by @MariusWirtz in #1013 - Add
execution_path
property toChore
class by @wimgielis in #1021 - Redesign legacy
require_admin
decorators to more granularrequire_data_admin
etc. checks by @adscheevel in #1016 - New
extract_cellset_axes_raw_async
,extract_cellset_cell_async
andextract_cellset_axes_cardinality
by @vmitsenko in #957 - Add function
clear_with_dataframe
to clear cubes with dataframe #1006 by @151N3 in #1026, #1032 - Add function
get_values
by @raeldor in #1020 - Fix issue on
restore_from_file
function by @MariusWirtz in #1039 - Redesign TM1py services architecture by @rclapp and @adscheevel in #1042
- Substite nan attribute values with sensible values in
execute_mdx_dataframe
wheninclude_attributes
isTrue
by @Kevin-Dekker in #1045 - Add
search_string_in_name
function to search for files in TM1 by @adscheevel in #1049
Stats
- Contributors: 15
- Commits: 178
- Changed Files: 72
- Added Lines: 7,205
- Deleted Lines: 1,643
How to upgrade TM1py
pip install tm1py --upgrade
New Contributors
- @vmitsenko made their first contribution in #923
- @hermie64 made their first contribution in #924
- @MBonotto made their first contribution in #987
- @yyzz1010 made their first contribution in #1018
- @wimgielis made their first contribution in #1021
- @151N3 made their first contribution in #1026
Full Changelog: 1.11.1...2.0