Skip to main content

Compute and visualize the sustainability impacts of alloys based on their chemical composition.

Project description

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alloysustainability-0.1.4.tar.gz (64.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

AlloySustainability-0.1.4-py3-none-any.whl (64.1 kB view details)

Uploaded Python 3

File details

Details for the file alloysustainability-0.1.4.tar.gz.

File metadata

  • Download URL: alloysustainability-0.1.4.tar.gz
  • Upload date:
  • Size: 64.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for alloysustainability-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d7e0fb4a65a345a099c812805f8b012c44136abbc0807a9290244ee7ba7b8b18
MD5 caa7be63c5281aec40b5543a8cef2144
BLAKE2b-256 29537f7ba7653a54df9f1947e262cf976a015a10aaa89f01d2dc1c71f810cc01

See more details on using hashes here.

File details

Details for the file AlloySustainability-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for AlloySustainability-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a56b19220c97e106ee4ef054f56b1d8c83268f0eef7d68bd5ee30f17714611a4
MD5 f1d67d15cfeab05c6520eb2212e8c3ed
BLAKE2b-256 c671d015751d0d4bc345d299c8274a81a54f4102ae0f665bf1ba41134303770d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page