Skip to content

1.10.0

Compare
Choose a tag to compare
@MariusWirtz MariusWirtz released this 10 Oct 14:00
· 375 commits to master since this release

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 in ChoreStartTime class to allow 0 values by @samuelko123 in #686
  • Add substitute_title function to MDXView by @MariusWirtz in #687
  • Add include_headers argument to extract_cellset_csv function by to @MariusWirtz in #689
  • Add remove_edge function to ElementService 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 to ElementService. 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 for rules update on Cube 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 on Hierarchy by @MariusWirtz in #732
  • Read 'NA' element name as a string instead of pandas NaN 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 exposing measure_dimension_elements to write_async function by @MariusWirtz in #753
  • Introduce get_descendant_edges function in Hierarchy 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 and element_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, and check_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 the GitService 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 with use_ti=True by @MariusWirtz in #808
  • Enable TCP keepalive option for long run requests by @macsir in #807
  • Additional features in ServerService : CubeSaveData and DeleteAllPersistentFeeders by @Mr-SabyasachiBose in #810

New Contributors

How to upgrade TM1py

To upgrade TM1py, just use the following command:

pip install TM1py --upgrade

Full Changelog: 1.9.0...1.10.0