1.10.0
Highlights
Performance improvements on all major TM1 I/O functions.
from TM1py import TM1Service
with TM1Service(address="", port=12354, ssl=True, user="admin", password="") as tm1:
df = tm1.cells.execute_view_dataframe(cube_name="Sales", view_name="Default", private=False)
Time | State | SalesMeasure | Value | |
---|---|---|---|---|
0 | 202001 | CA | Gross Margin | 13924.8 |
1 | 202001 | CA | Revenue | 41330.4 |
2 | 202001 | CA | COGS | 27405.6 |
from TM1py import TM1Service
with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1:
cells = {
('Belgium', 'Actual', '2022', 'Apr', 'Revenue'): 10_000,
('Belgium', 'Actual', '2022', 'May', 'Revenue'): 15_000,
...
('Belgium', 'Actual', '2022', 'Jun', 'Revenue'): 20_000,
('Belgium', 'Actual', '2022', 'Apr', 'Revenue'): 45_000,
}
tm1.cells.write_async(cube_name="Sales", cells=cells, slice_size=32_000, max_workers=4,
measure_dimension_elements={'Revenue': 'Numeric'})
Full support for TM1's git deployment functionality. Including the TM1Project and deployment definitions.
with TM1Service(address="", port=11247, ssl=True, user="admin", password="") as tm1:
project = TM1Project(name="Project Definition")
dev_deployment = TM1ProjectDeployment(
deployment_name="Dev",
settings={"ServerName": "dev"})
dev_deployment.add_task(TM1ProjectTask(
task_name="Security Refresh",
process="Bedrock.Security.Refresh"))
dev_deployment.include_all_attribute_dimensions(tm1)
dev_deployment.add_ignore(object_class="Cubes", object_name="*")
project.add_deployment(deployment=dev_deployment)
tm1.git.tm1project_put(project)
New and more efficient ways to query and control elements and hierarchies.
from TM1py import TM1Service
with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1:
# break edge as one tiny atomic operation
tm1.elements.remove_edge(dimension_name="Region", hierarchy_name="Region", parent="EU", component="UK")
# add new edge as one tiny atomic operation
tm1.elements.add_edges(dimension_name="Region", hierarchy_name="Region", edges={("Other", "UK"): 1})
from TM1py import TM1Service
with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1:
is_parent = tm1.elements.element_is_parent(dimension_name="Region", hierarchy_name="Region", parent_name="Other",
element_name="UK")
is_ancestor = tm1.elements.element_is_ancestor(dimension_name="Region", hierarchy_name="Region",
element_name="Other", ancestor_name="UK")
Heaps of miscellaneous features, optimizations and improvements that make your life easier when doing TM1 with Python.
from TM1py import TM1Service
with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1:
process_names = tm1.processes.search_string_in_code(search_string="Sunrise", skip_control_processes=True)
from TM1py import TM1Service
with TM1Service(base_url="https://localhost:12354", user="admin", password="apple") as tm1:
tm1.cubes.cube_save_data("Sales")
New Features and Improvements
- Fix in
set_time
function inChoreStartTime
class to allow 0 values by @samuelko123 in #686 - Add
substitute_title
function toMDXView
by @MariusWirtz in #687 - Add
include_headers
argument toextract_cellset_csv
function by to @MariusWirtz in #689 - Add
remove_edge
function toElementService
to break individual parent-child relationship in one operation by @MariusWirtz in #693 - Fix bug to allow dimension creation from JSON file by @MariusWirtz in #698
- Improve performance of critical
build_cellset_from_pandas_dataframe
function by @Kevin-Dekker in #695 - Add
get_parents
function toElementService
. Allows retrieval of all parents for an element by @MariusWirtz in #699 - Fix doubled double quotes issue in element names by @MariusWirtz in #704
- Explicitly add elements to leaves hierarchy so solve #702 by @MariusWirtz in #703
- Handle duplicates in
write_dataframe
appropriately by @MariusWirtz in #708 & #712 - Accept
str
forrules
update onCube
object by @MariusWirtz in #710 - New search function to find substrings in Rules or Processes (e.g.,
search_string_in_code
) by @adscheevel in #723 - Fix write failure for element names with
:
by @MariusWirtz in #724 - Add
get_element_principal_name
function by @MaaYuu in #731 - Add
get_ancestors
,get_descendants
functions onHierarchy
by @MariusWirtz in #732 - Read
'NA'
element name as a string instead of pandasNaN
by @MariusWirtz in #739 - Align float numbers intelligently when writing through unbound processes, to avoid "Number too big" TI errors during writeback, by @pbuncik in #749
- Add functions to find views that contain a specified subset by @adscheevel in #751
- Improve
write_async
performance by exposingmeasure_dimension_elements
towrite_async
function by @MariusWirtz in #753 - Introduce
get_descendant_edges
function inHierarchy
class by @skriptmeister42 in #760 - Fix the update function in
ApplicationService
to use the update operation instead of the delete and recreate approach, to avoid breaking existing references of the application by @jrobinsonLOR in #762 - Implement
element_is_parent
andelement_is_ancestor
by @rclapp in #767 and #771 - Allow queries with selection on more than 3 axes in the
execute_mdx
function by @MariusWirtz in #777 - Add support for
trace_cell_calculation
,trace_cell_feeders
, andcheck_cell_feeders
by @rclapp in #780 - Add function
create_many
in AnnotationService to create many annotations in one operation by @MariusWirtz in #785 - Add new element functions like
get_consolidated_elements
,get_parents_of_all_elements
by @adscheevel in #792 - Adjust TM1py to changes in mdxpy 0.4 by @MariusWirtz in #793
- Handle
TM1Project
in theGitService
by @nicolasbisurgi in #775 and #796 - Refactor Breakpoints and introduce new debugging functionality by @adscheevel in #791
- Allow alternative separators for elements in
get_value
and other functions by @tobiaskapser in #801 and #805 - Use 100k max statements in
write
function withuse_ti=True
by @MariusWirtz in #808 - Enable TCP keepalive option for long run requests by @macsir in #807
- Additional features in
ServerService
:CubeSaveData
andDeleteAllPersistentFeeders
by @Mr-SabyasachiBose in #810
New Contributors
- @samuelko123 made their first contribution in #686
- @Kevin-Dekker made their first contribution in #695
- @MaaYuu made their first contribution in #731
- @pbuncik made their first contribution in #749
- @skriptmeister42 made their first contribution in #760
- @jrobinsonLOR made their first contribution in #762
- @nicolasbisurgi made their first contribution in #775
- @tobiaskapser made their first contribution in #801
- @Mr-SabyasachiBose made their first contribution in #810
How to upgrade TM1py
To upgrade TM1py, just use the following command:
pip install TM1py --upgrade
Full Changelog: 1.9.0...1.10.0