Skip to content

Commit

Permalink
Merge branch 'main' into newdir_96
Browse files Browse the repository at this point in the history
  • Loading branch information
dangunter authored May 2, 2024
2 parents c2c84c0 + b4badf7 commit a812928
Show file tree
Hide file tree
Showing 229 changed files with 15,925 additions and 3,692 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,20 @@ defaults:
shell: bash -l {0}

jobs:
spell-check:
name: Check Spelling
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Run Spell Checker
uses: crate-ci/typos@master

pytest:
# description: Run pytest with dev dependencies
name: pytest (py${{ matrix.python-version }}/${{ matrix.os }})
runs-on: ${{ matrix.runner-image }}
needs: [spell-check]
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ idaes_examples/notebooks/**/pysmo/*.pickle
idaes_examples/notebooks/**/omlt/keras_surrogate/*.pb
idaes_examples/notebooks/**/omlt/keras_surrogate/*.pdf
idaes_examples/notebooks/**/omlt/*.pdf
idaes_examples/notebooks/docs/power_gen/solid_oxide_cell/soc_dynamic_flowsheet.svg
alamo_run.alm
idaes_examples/notebooks/docs/tut/sin_data.csv
*.pb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
"outputs": [],
"source": [
"# Add the model references to the tag metadata based on the strings above.\n",
"da.upadate_metadata_model_references(m, df_meta)"
"da.update_metadata_model_references(m, df_meta)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"It can be useful to visualize the measurement data and estimated uncertainty. The following creates box and whisker plots for each tag based on the data bins. A large number of plots may be created, so to manage them more easily, they are saved as PDFs and merged into a single multi-page PDF document. The deafault file name for the resulting PDF is \"data_plot_book.pdf.\""
"It can be useful to visualize the measurement data and estimated uncertainty. The following creates box and whisker plots for each tag based on the data bins. A large number of plots may be created, so to manage them more easily, they are saved as PDFs and merged into a single multi-page PDF document. The default file name for the resulting PDF is \"data_plot_book.pdf.\""
]
},
{
Expand Down Expand Up @@ -384,7 +384,7 @@
"outputs": [],
"source": [
"# Add the model references to the tag metadata based on the strings above.\n",
"da.upadate_metadata_model_references(m, df_meta)"
"da.update_metadata_model_references(m, df_meta)"
]
},
{
Expand Down Expand Up @@ -413,7 +413,7 @@
"from idaes.core.util.tags import ModelTagGroup\n",
"\n",
"# This function creates a dictionary of streams based of streams based on model arcs. The function\n",
"# also takes an addtional set of stream-like objects for add to the stream dictionary. In this case,\n",
"# also takes an additional set of stream-like objects for add to the stream dictionary. In this case,\n",
"# this is a single unit and the flowsheet doesn't contain any arcs, so we add the economized inlet and\n",
"# outlet ports to the stream dictionary.\n",
"stream_dict = ta.arcs_to_stream_dict(\n",
Expand Down Expand Up @@ -459,7 +459,7 @@
" except KeyError:\n",
" pass\n",
"\n",
"# Any addtional tags can be added. This is required for tags that cannot be systematically generated\n",
"# Any additional tags can be added. This is required for tags that cannot be systematically generated\n",
"# from the model streams.\n",
"recon_tags.add(expr=m.fs.econ.heat_duty[0], name=\"ECON_Q\", format_string=\"{:.3f}\")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"metadata": {},
"source": [
"## Importing Packages\n",
"We start by importing several standard Python modules for convienience. "
"We start by importing several standard Python modules for convenience. "
]
},
{
Expand Down Expand Up @@ -339,7 +339,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally, we introduce a single descriptor for the weighted combination of acitivity and stability. \n",
"Finally, we introduce a single descriptor for the weighted combination of activity and stability. \n",
"By changing the parameter weighting the catalytic portion of the objective function, we can optimize for a range of designs optimizing stability and activity. "
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"source": [
"## Importing Packages\n",
"\n",
"We start by importing several standard Python modules for convienience."
"We start by importing several standard Python modules for convenience."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
"\n",
"In this module, we introduce the **MatOpt** interface for representing material properties and specifying optimization problems. \n",
"\n",
"We have designed the interface with severl goals in mind:\n",
"We have designed the interface with several goals in mind:\n",
"\n",
"1. To **simplify the representation of nanostructured materials,** streamlining the creation of materials optimization problems. \n",
"2. To provide a simple interface so that users **do not need to understand the details of building mathematical optmization models** or the syntax of the Pyomo package. \n",
"2. To provide a simple interface so that users **do not need to understand the details of building mathematical optimization models** or the syntax of the Pyomo package. \n",
"3. To **automate many of the common steps of materials optimization,** speeding up the development of new models. \n",
"\n",
"As an example system, we will consider the minimization of cohesive energy in nanoclusters, recently demonstrated in:\n",
"\n",
"Isenberg, N. M., et al., \"Identification of Optimally Stable Nanocluster Geometries via Mathematical Optimization and Density Functional Theory,\" *Molecular Systems Design & Engineering* 5 (2020): 232-244. DOI: [10.1039/C9ME00108E](https://pubs.rsc.org/en/content/articlelanding/2020/me/c9me00108e#!divAbstract).\n",
"\n",
"We seek to identify the geometry that minimizes the cohesive energy of a nanocluster on the face-centered cubic (FCC) lattice. \n",
"As a model for cohesive energy, we use model based on the square-root of coordination number, refered to as the Tomanek model [[1]](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.28.665).\n",
"As a model for cohesive energy, we use model based on the square-root of coordination number, referred to as the Tomanek model [[1]](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.28.665).\n",
"In the equation below, we define the normalized cohesive energy, as the normalized contribution of the square root of the coordination number. \n",
"\n",
"$$\\hat{E}^{\\text{surf}} = \\frac{1}{N \\sqrt{12}} \\displaystyle \\sum_i \\sqrt{CN_i} $$\n",
Expand Down Expand Up @@ -178,7 +178,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The MatOptModel additionally hold lists of ***MaterialDescriptor*** objects that define the relevant material desriptors. \n",
"The MatOptModel additionally hold lists of ***MaterialDescriptor*** objects that define the relevant material descriptors. \n",
"By default, several universal site descriptors are pre-defined in the model. \n",
"From these, all other material descriptors can be defined.\n",
"\n",
Expand Down Expand Up @@ -353,7 +353,7 @@
" Default: True\n",
" tilim (float): Optional, solver time limit (in seconds).\n",
" Default: 3600\n",
" trelim (float): Optional, solver tree memeory limit (in MB).\n",
" trelim (float): Optional, solver tree memory limit (in MB).\n",
" Default: None (i.e., Pyomo/CPLEX default)\n",
" solver (str): Solver choice. Currently only cplex or neos-cplex are supported\n",
" Default: cplex\n",
Expand Down
4 changes: 2 additions & 2 deletions idaes_examples/archive/matopt/nanowire_design_src.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"metadata": {},
"source": [
"## Importing Packages\n",
"We start by importing several standard Python modules for convienience. "
"We start by importing several standard Python modules for convenience. "
]
},
{
Expand Down Expand Up @@ -161,7 +161,7 @@
"source": [
"## Building a Model\n",
"\n",
"In this example, we will build a model that maximizes the cohesive energy of the nanowire as an indicator of it's thermal stability. To begin, we start by creating a **MatOptModel** object to hold information about the model. Notice that we use a list of empty atoms as our set of building blocks because we will use a cohesive energy function for semiconductor materials that is indepedent of atom types. Thus, we do not need to specify the types of building blocks in our model."
"In this example, we will build a model that maximizes the cohesive energy of the nanowire as an indicator of it's thermal stability. To begin, we start by creating a **MatOptModel** object to hold information about the model. Notice that we use a list of empty atoms as our set of building blocks because we will use a cohesive energy function for semiconductor materials that is independent of atom types. Thus, we do not need to specify the types of building blocks in our model."
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions idaes_examples/archive/matopt/surface_design_src.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"metadata": {},
"source": [
"## Importing Packages\n",
"We start by importing several standard Python modules for convienience. "
"We start by importing several standard Python modules for convenience. "
]
},
{
Expand Down Expand Up @@ -211,7 +211,7 @@
"source": [
"First, we introduce two rules to fix special sites in the design. \n",
"We fix the bottom two layers of atoms to exist, creating underlying bulk layers above which we will introduce nanostruced defets.\n",
"We also fix an arbitrary atom in the top layer, breaking symetry of the design space and resulting in easier to solve opitmization problems without actually restricting the designs that can be possibly represented. "
"We also fix an arbitrary atom in the top layer, breaking symmetry of the design space and resulting in easier to solve opitmization problems without actually restricting the designs that can be possibly represented. "
]
},
{
Expand Down Expand Up @@ -241,7 +241,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we introduce constraints thtat require atoms to be placed on top of each other, avoiding hollow pockets below the surface. "
"Next, we introduce constraints that require atoms to be placed on top of each other, avoiding hollow pockets below the surface. "
]
},
{
Expand Down Expand Up @@ -311,7 +311,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we define a simple model for the surface energy of nanostructured slabs as a piecwise linear function of coordination number. "
"Next, we define a simple model for the surface energy of nanostructured slabs as a piecewise linear function of coordination number. "
]
},
{
Expand Down Expand Up @@ -473,7 +473,7 @@
"metadata": {},
"source": [
"## Processing Solutions\n",
"Once the model is solved, we can plot the resulting design. However, it is often useful to label atoms according to some auxilliary information. In this case, we would like to label atoms that consitute ideal reactive sites. We loop over the sites and set the atom to S to highlight the sites that are reactive. Then, we can write the Design object to PDB or CFG files for plotting.\n",
"Once the model is solved, we can plot the resulting design. However, it is often useful to label atoms according to some auxiliary information. In this case, we would like to label atoms that constitute ideal reactive sites. We loop over the sites and set the atom to S to highlight the sites that are reactive. Then, we can write the Design object to PDB or CFG files for plotting.\n",
"\n",
"Additionally, we can manipulate the resulting design to better see the periodic pattern. Here, we replicate the design four times to see the periodic pattern. "
]
Expand Down
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit a812928

Please sign in to comment.