Introducing EDEMpy

EDEMPy is a Python library for accessing EDEM data from .h5 files (the underlying EDEM file format).

EDEMpy enables pre- and post-processing of EDEM data using the vast array of tools offered by the Python ecosystem. EDEMpy does not require advanced programming knowledge.

EDEMpy is installed by default with EDEM, including its dependencies: NumPy and h5py. It is also recommended to install the following tools, as these are commonly used by EDEM users and are required for some of the examples (available on the EDEM knowledge base):

  • Spyder IDE: Free and easy-to-use programming interface for Python
  • Matplotlib: Python library for data plotting and visualization

The officially supported platform for EDEMpy is currently Python 3.8.10. The default Altair installation path includes the correct version installed at:

Windows: C:\Program Files\Altair\2022.3\common\python\python3.8\win64\python.exe
Linux: ~/2022.3/altair/common/python/python3.8/linux64/bin/python

It is not safe to modify the Altair Python installation by installing EDEMpy or any other packages. This could cause unexpected behavior in EDEM and other Altair software. Instead, follow the instructions below to create an independent Virtual Environment for each project.

Setting up a Python Virtual Environment

A Python Virtual Environment is a folder containing a standalone Python installation. It is recommended to create a new Virtual Environment for each Python project, as this helps to keep track of project dependencies and makes it a lot easier to share Python projects with others.

Create a new Virtual Environment using these commands (replacing "path\to\myenv" with the desired path for the new folder).

Windows

cd C:\Program Files\Altair\2022.3\common\python\python3.8\win64
python.exe -m venv --system-site-packages C:\path\to\myenv

Linux

cd ~/2022.3/altair/common/python/python3.8/linux64/bin
./python -m venv --system-site-packages ~/path/to/myenv

Once the environment has been created, it must be **activated**. Activating the environment means that any further `python` commands or scripts will run inside this new version of Python. Activate the environment using these commands.

Windows (Command Prompt)

path\to\myenv\Scripts\Activate.bat

Windows (PowerShell)

path\to\myenv\Scripts\Activate.ps1

Linux

source path\to\myenv\bin\activate

Now that the environment is active, see the next section to install EDEMpy. To deactivate the environment at any time, use the `deactivate` command.

See the official Python documentation for more information.

Installing EDEMpy

The EDEM installation folder includes EDEMpy as a PIP package file ready to be installed. The default EDEM installation path is:

Windows:C:\Program Files\Altair\2022.3\EDEM\EDEMpy\

Linux:~/2022.3/altair/EDEM/EDEMpy/

To install EDEMpy, open a console window from the folder and use the following command:

python -m pip install edempy-(version).whl

Getting Started with EDEMpy Documentation

EDEMpy's API documentation is included within the EDEM installation files. The documentation can be found at EDEMpy API reference help.

Alternatively, the default installation path is:

Windows:C:\Program Files\Altair\2022.3\EDEM\EDEMpy\help\index.html

Linux:~/2022.3/altair/EDEM/EDEMpy/help/index.html

The same information can also be accessed for individual functions directly inside a Python console via the built-in help() command. For example, to see documentation for the Deck class:

python
>>> import edempy
>>> help(edempy.Deck)

A set of EDEMpy examples on the EDEM community pages is also available.

(c) 2023 Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support