Skip to main content

AlloySustainability

AlloySustainability is a Python package designed to compute and visualize the sustainability impacts of alloys based on their elemental composition. It retrieves key indicators from external data sources (including a file automatically downloaded from GitHub) and produces comprehensive metrics and visualizations.

Features

  • Compute Indicators: Given the mass fractions of 18 elements composing an alloy, compute a range of sustainability indicators (e.g., mass price, supply risk, embodied energy, water usage).
  • Embedded Data: The package includes two CSV files (gen_RTHEAs_vs_Fe_df.csv, gen_HTHEAs_vs_Ni_df.csv) embedded within the package, providing baseline reference data for comparison.
  • Automatic Data Retrieval: A third CSV file (gen_18element_imputed_v202412.csv) is automatically downloaded from GitHub, ensuring that you always have the latest data.
  • Visualization: Easily generate comparative plots (e.g., violin plots) to compare the new alloy’s metrics against reference classes such as FCC HEAs, BCC HEAs, Steels, and Ni-based alloys.

Installation

Install AlloySustainability directly from PyPI:

pip install AlloySustainability

Recommended Environment: Google Colab

To ensure the best experience and compatibility, it is highly recommended to use Google Colab for running this package. Google Colab provides a preconfigured Python environment with most dependencies pre-installed, and it allows seamless integration with cloud-based data retrieval.

To get started:

  1. Open Google Colab.
  2. Install the package.
  3. Run the example usage code in a Colab notebook.

This ensures minimal configuration and avoids potential environment-related issues.

Usage

from AlloySustainability.computations import (
    load_element_indicators,
    load_RTHEAs_vs_Fe_df,
    load_HTHEAs_vs_Ni_df,
    compute_impacts
)
from AlloySustainability.visualization import plot_alloy_comparison
import matplotlib.pyplot as plt

# Load data
element_indicators = load_element_indicators()
RTHEAs_Fe_df = load_RTHEAs_vs_Fe_df()
HTHEAs_Ni_df = load_HTHEAs_vs_Ni_df()

# Define the alloy composition (mass fractions of 18 elements)
# Make sure the fractions sum up to 1.0
composition_mass = [0, 0.2, 0.2, 0, 0, 0, 0.2, 0, 0, 0.2, 0, 0, 0, 0, 0, 0, 0.2]

# Compute the sustainability impacts
new_alloy_impacts = compute_impacts(composition_mass, element_indicators)

# Visualize the alloy impacts compared to reference classes
fig = plot_alloy_comparison(new_alloy_impacts, RTHEAs_Fe_df, HTHEAs_Ni_df)
plt.show()

Requirements

  • Python 3.6+
  • numpy
  • pandas
  • matplotlib
  • seaborn
  • requests

Further Reading

For more information on sustainability indicators in the context of high entropy alloys, please refer to:

Considering sustainability when searching for new high entropy alloys S. Gorsse, T. Langlois, M. R. Barnett Sustainable Materials and Technologies 40 (2024) e00938 https://doi.org/10.1016/j.susmat.2024.e00938

Release files for AlloySustainability 0.1.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 AlloySustainability 0.1.7
File Size Uploaded
alloysustainability-0.1.7.tar.gz 66.1 kB Details

Built distribution (wheel)

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

Total release size: 131.4 kB

Release files / alloysustainability-0.1.7.tar.gz

Download URL alloysustainability-0.1.7.tar.gz
Size 66.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1b0473a67b518bfd10b2d4b25d887e2aa027637678f3412f7a6f9a5f647ce4cc
BLAKE2b-256 checksum
How to use checksums
f3f35fdd8e78114e1bd168a613a965cb3aa1ed234bb738678f9416047b6ef434
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.4

Release files / AlloySustainability-0.1.7-py3-none-any.whl

Download URL AlloySustainability-0.1.7-py3-none-any.whl
Size 65.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86bf5d8c9e7af86b847e57cf3b44563044a52c9a2e12fa02459588d742e7dc76
BLAKE2b-256 checksum
How to use checksums
2372e366c8a6f0f15843b0dbb5578d20c64d7cef28e01d05231293c1577f546a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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