TC-Python is an Application Programming Interface (API) which makes it possible to perform Thermo-Calc calculations from Python™ code. It is developed for a general-purpose next-generation API, and provides state-of-the-art usability for a large number of technical and scientific tasks. Henrik Lasu, MSc, and Dr. Ralf Rettig, both software developers at Thermo-Calc Software, discuss the advantages of TC-Python in this blog post.
TC-Python covers nearly all functionality available in all Thermo-Calc products, not only thermodynamic calculations. It is a fluent API that relies heavily on builder pattern with method chaining. For many of our products, such as the Precipitation Module, Scheil calculations and Property Models, TC-Python provides an API for the first time. The API is easy to use, has good default values, and provides meaningful error messages.
Access to Thermo-Calc Functionalities
TC-Python is developed with focus on user-friendliness and modern object-oriented design. The access to all Thermo-Calc functionality is to a great extent unified. For example, all method and class names follow the same pattern and there is a single overall architecture which makes the usage of the different modules similar. All kinds of calculations can be combined without having to worry about interference. The following modules are available:
Single equilibrium calculation
Batch equilibrium calculations
Single-axis (property) diagrams
Support for Digital Twins and Material Lifecycles
TC-Python is also a powerful tool for Integrated Computational Materials Engineering (ICME), and is applied for developing digital twins of production process and material lifecycles in various industries. Based on the programming language Python™, which embraces an enormous ecosystem for technical, scientific and also many other fields of applications, TC-Python can easily be integrated with other commercial and open-source applications. Examples of these are:
High-throughput calculation of material properties and processing condition
Optimization of material compositions and processes based on material properties
Reproducible calculations following good scientific practice
Providing material data for other applications, such as Finite Element Method (FEM) and Computational Fluid Dynamics (CFD)
Programming user-specific tools required for daily operations
Scientific model development
Solving specific tasks that are currently not available in the Thermo-Calc Graphical User Interface (GUI)
Any material engineer who requires quick information about material properties, especially if these are not directly available through the graphical user interface, will enjoy TC-Python. It is perfect for high-throughput calculations and optimizations. Companies that aim to digitialize their material development, or require very specialized calculations on a daily basis, can quickly develop them with TC-Python and the Python™ ecosystem. Python™ allows providing small user-specific applications that can even be applied by their non-scientific workforce.
A Vast Code Library Applicable to Most Industries
TC-Python is a broad library that can be applied in practically any industry involved in material processing or application. Currently, the metal industry are keen users, as it supports in realizing the digital transformation of the industry through virtual material and process models. This includes steel, light-metals, semiconductors, heat treatment, casting and rolling.
In-house Experience Promotes User Experience
TC-Python is even a widely applied inhouse tool at Thermo-Calc Software. It is used in business areas such as rapid prototyping of models, algorithms and software, validation calculations, database development, continuous integration and massive-parallel computations. Thermo-Calc users benefit from the internal applications. Thermo-Calc developers learn directly about the user experience of the API, and thereby build up vast application knowledge.
Getting Started with TC-Python
Everyone who uses Thermo-Calc and has an interest in programming can use TC-Python. There is no need to be an experienced programmer. Still, the more used one is to a modern object-oriented language, with a rich set of third-party tools, the easier it is to get started. The best way to get familiarized is to watch the video tutorial Getting Started with TC-Python. It is also advisable to run and modify the examples that are installed with Thermo-Calc software.
TC-Python is available from Thermo-Calc version 2018a and can be used with all operating systems supported by Thermo-Calc. It has been extended ever since. Also in the 2020b release, new features are available for TC-Python. If you are interested in TC-Python, please contact email@example.com.
Graduated in Materials Science and Engineering at the University of Erlangen in Germany in 2006. Ralf Rettig finished his PhD on modelling the precipitation of TCP-phases in nickel-based superalloys in 2010. After working as a group leader for high temperature materials at the University of Erlangen, he joined Thermo-Calc Software in Stockholm in 2016. Dr. Rettig has been working on a variety of projects, especially on the development of TC-Python and the Process Metallurgy Module. Dr. Rettig enjoys bringing software development and engineering together.
Henrik Lasu, MSc
Has worked as a software developer since 1999, and joined Thermo-Calc Software in 2012. He has a master of science in mathematics from the Royal Institute of Technology (Kungliga Tekniska Högskolan) in Stockholm. Preferring the programming languages Python™ and Java, Henrik Lasu is also a full stack developer who enjoys writing code in all parts of Thermo-Calc software. Together with Dr. Ralf Rettig and the Thermo-Calc development team, he founded and evolved TC-Python.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
HubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.
This cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.
5 months 27 days
This is the main cookie set by Hubspot, for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).
The _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
This cookie is installed by Google Analytics.
A variation of the _gat cookie set by Google Analytics and Google Tag Manager to allow website owners to track visitor behaviour and measure site performance. The pattern element in the name contains the unique identity number of the account or website it relates to.
Installed by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
Linkedin set this cookie to store information about the time a sync took place with the lms_analytics cookie.
YouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.
5 months 27 days
HubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.
Wistia sets this cookie to collect data on visitor interaction with the website's video-content, to make the website's video-content more relevant for the visitor.