Skip to main content

Electron Microscopy Machine Learning (EMicroML)

Test library Code Coverage Documentation PyPi Version Conda-Forge Version License DOI

emicroml is a Python library for training machine learning models for applications in electron microscopy.

Visit the emicroml website for a web version of the installation instructions, the reference guide, and the examples archive.

The source code can be found in the emicroml GitHub repository.

Table of contents

Instructions for installing and uninstalling emicroml

Installing emicroml

For all installation scenarios, first open up the appropriate command line interface. On Unix-based systems, you could open e.g. a terminal. On Windows systems you could open e.g. an Anaconda Prompt as an administrator.

Before installing emicroml, it is recommended that users install PyTorch in the same environment that they intend to install emicroml according to the instructions given here for their preferred PyTorch installation option.

Installing emicroml using pip

Before installing emicroml, make sure that you have activated the (virtual) environment in which you intend to install said package. After which, simply run the following command:

pip install emicroml

The above command will install the latest stable version of emicroml.

To install the latest development version from the main branch of the emicroml GitHub repository, one must first clone the repository by running the following command:

git clone https://github.com/mrfitzpa/emicroml.git

Next, change into the root of the cloned repository, and then run the following command:

pip install .

Note that you must include the period as well. The above command executes a standard installation of emicroml.

Optionally, for additional features in emicroml, one can install additional dependencies upon installing emicroml. To install a subset of additional dependencies (along with the standard installation), run the following command from the root of the repository:

pip install .[<selector>]

where <selector> can be one of the following:

  • tests: to install the dependencies necessary for running unit tests;
  • examples: to install the dependencies necessary for executing files stored in <root>/examples, where <root> is the root of the repository;
  • docs: to install the dependencies necessary for documentation generation;
  • all: to install all of the above optional dependencies.

Alternatively, one can run:

pip install emicroml[<selector>]

elsewhere in order to install the latest stable version of emicroml, along with the subset of additional dependencies specified by <selector>. Note that the Python library pyprismatic>=2.0 must be installed prior to executing either of the last two commands with <selector> set to examples. The easiest way to install this additional dependency is within a conda virtual environment, using the following command::

conda install -y pyprismatic=*=gpu* -c conda-forge

if CUDA version >= 11 is available on your machine, otherwise users should run instead the following command::

conda install -y pyprismatic=*=cpu* -c conda-forge

For further discussions on running examples, see the pages Prerequisites for running example scripts or Jupyter notebooks without using a SLURM workload manager and Prerequisites for running example scripts or Jupyter notebooks using a SLURM workload manager.

Installing emicroml using conda

Before proceeding, make sure that you have activated the (virtual) conda environment in which you intend to install said package. For Windows systems, users must install PyTorch separately prior to following the remaining instructions below.

To install emicroml using the conda package manager, run the following command:

conda install -c conda-forge emicroml

The above command will install the latest stable version of emicroml.

Uninstalling emicroml

If emicroml was installed using pip, then to uninstall, run the following command:

pip uninstall emicroml

If emicroml was installed using conda, then to uninstall, run the following command:

conda remove emicroml

Learning how to use emicroml

For those new to the emicroml library, it is recommended that they take a look at the Examples page, which contain code examples that show how one can use the emicroml library. While going through the examples, readers can consult the emicroml reference guide to understand what each line of code is doing.

Reproducing data of preprints and published papers

Ultramicroscopy 283 (2026), 114347

The majority of the data presented in Ref. Fitzpatrick1 can be reproduced by running all of the examples listed on the page Examples of distortion estimation of CBED patterns.

How to cite emicroml

For estimation of optical distortion in CBED patterns

If you are using machine learning models constructed via our emicroml library to estimate optical distortion in convergent beam electron diffraction (CBED) patterns, please cite Ref. Fitzpatrick1.

Metadata

Release files for emicroml 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emicroml 0.0.7
File Size Uploaded Provenance Actions
emicroml-0.0.7.tar.gz 6.5 MB With provenance Details for emicroml-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for emicroml 0.0.7
File Interpreter ABI Platform Actions
emicroml-0.0.7-py3-none-any.whl Python 3 none any Details for emicroml-0.0.7-py3-none-any.whl

Total release size: 6.6 MB

Release files / emicroml-0.0.7.tar.gz

Download URL emicroml-0.0.7.tar.gz
Size 6.5 MB
Tags Source
SHA-256 checksum
How to use checksums
792df7516051a221b546863c9666091f5d92f8193f125a7f5a00d37d74ba7c2f
BLAKE2b-256 checksum
How to use checksums
297fba58b7a071699b5a76e3fde268152fc2e9300d955a94daa2694c0088ef64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Release files / emicroml-0.0.7-py3-none-any.whl

Download URL emicroml-0.0.7-py3-none-any.whl
Size 130.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e266e37b94f88c80bf821ae0171de277fbf2489e57f496a6b20f6ab24a26705
BLAKE2b-256 checksum
How to use checksums
505e990228dda65784256bf3da09ba565e4aae7b306751e0fa8379fdd6e75e53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Security for emicroml 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for emicroml-0.0.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page