Skip to content

Conversation

amkrajewski
Copy link
Contributor

A draft PR for @amr8004 to work on before we are ready to pull it and clean up the main afterwards

@amkrajewski amkrajewski requested review from Copilot and amr8004 August 22, 2025 15:00
@amkrajewski amkrajewski added the enhancement New feature or request label Aug 22, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR merges improvements from the development branch into main since the last paper publication. The changes primarily focus on configuration refactoring, enhanced callable generation, and improved computational capabilities.

Key changes include:

  • Refactored YAML configuration structure from callables to elementalSpaces
  • Added hybrid Scheil-equilibrium simulation capabilities
  • Enhanced computational density settings and new utility functions

Reviewed Changes

Copilot reviewed 17 out of 29 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
testing_input.yaml Removed old test configuration file
publication_input.yaml Added comprehensive publication configuration with design spaces and stitching
import_yaml.py New utility for parsing YAML configurations and generating component mappings
example_input.yaml Added example configuration demonstrating multi-phase path planning
ammap/templates/hybrid_scheil_eq_callable_template.py New template for hybrid Scheil-equilibrium calculations
ammap/templates/equilibrium_callable_template.py Increased computational density from 2000 to 5000
ammap/callables/yaml_tools.py New utility for updating feasible phases in YAML files
ammap/callables/plotting.py New 3D graph plotting functionality using igraph and plotly
ammap/callableBuilders/hybrid_callables.py New builder for hybrid callable generation
ammap/callableBuilders/construct_callables_combo.py Enhanced callable builder supporting multiple constraint types
ammap/callableBuilders/construct_callables.py Updated to use elementalSpaces instead of callables
UPDATE.txt Documentation of changes to implement
Ti-Al-V-Cr.TDB Added thermodynamic database for Ti-Al-V-Cr system
Old_demos_and_workshops/AMMapDemonstration.ipynb Updated execution counts and added error handling
CONICRFE_input.yaml New configuration for Co-Ni-Cr-Fe system analysis

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Path(f"{output_dir}/__init__.py").touch()

# Read the hybrid Scheil-equilibrium template file
with open('ammap/templates/hybrid_scheil_eq_callable_template_perp.py', 'r') as f:
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file path 'hybrid_scheil_eq_callable_template_perp.py' does not match the actual template file 'hybrid_scheil_eq_callable_template.py' that was added to the repository. This will cause a FileNotFoundError.

Suggested change
with open('ammap/templates/hybrid_scheil_eq_callable_template_perp.py', 'r') as f:
with open('ammap/templates/hybrid_scheil_eq_callable_template.py', 'r') as f:

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import re

# Load the YAML file
with open('example_input.yaml', 'r') as file:
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded filename 'example_input.yaml' should be parameterized to make the script reusable with different input files. Consider accepting the filename as a command-line argument or function parameter.

Suggested change
with open('example_input.yaml', 'r') as file:
import argparse
parser = argparse.ArgumentParser(description='Process a YAML file.')
parser.add_argument('filename', type=str, help='Path to the input YAML file')
args = parser.parse_args()
# Load the YAML file
with open(args.filename, 'r') as file:

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

@amkrajewski amkrajewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amr8004 Please have a look at my comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amr8004 This probably should land in some examples or tutorial directory

CoCrFeNi.ipynb Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably should land in some examples or tutorial directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The publication demonstration can proably stay in root

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably should land in some examples or tutorial directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renamig the folder to proper snake case with lower-case o

UPDATE.txt Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need to delete this one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstrings need an overhaul in terms of what it does. Examples should also move to the docstring

# Combine all the names of each entry in designSpaces
attainableSpaceComponents = []
for entry in design_spaces:
components = re.findall(r'[A-Z][a-z]*', entry['name'])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be simplified

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This belongs next to publication YAML for now, but probably should land in some examples or tutorial directory later

Path(f"{output_dir}/__init__.py").touch()

# Read the hybrid Scheil-equilibrium template file
with open('ammap/templates/hybrid_scheil_eq_callable_template_perp.py', 'r') as f:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amkrajewski
Copy link
Contributor Author

In the templates, you should change names of capitalized variables like 'Sfrac' or 'T_eq'. You can consider something like 'fracS' or 'eqT'. You can use capitalized constants

@amkrajewski
Copy link
Contributor Author

Good progress overall 😃 Food for thought - we need to think about how to generalize populating the templates at some point, so that it is easy to do it with a substitution dictionary rather than hardcoding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants