Credits
+Maintainer
+-
+
Ryuichi Shimogawa <ryuichi.shimogawa@stonybrook.edu>
+
Contributors
+-
+
Maichong Xie
+Anatoly I. Frenekel
+Marc R.Knecht
+
' + + '' + + _("Hide Search Matches") + + "
" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/authors.html b/authors.html new file mode 100644 index 0000000..903ddff --- /dev/null +++ b/authors.html @@ -0,0 +1,135 @@ + + + + + + +Ryuichi Shimogawa <ryuichi.shimogawa@stonybrook.edu>
Maichong Xie
Anatoly I. Frenekel
Marc R.Knecht
Contributions are welcome, and they are greatly appreciated! Every little bit +helps, and credit will always be given.
+You can contribute in many ways:
+Report bugs at https://github.com/Ameyanagi/decomnano/issues.
+If you are reporting a bug, please include:
+Your operating system name and version.
Any details about your local setup that might be helpful in troubleshooting.
Detailed steps to reproduce the bug.
Look through the GitHub issues for bugs. Anything tagged with “bug” and “help +wanted” is open to whoever wants to implement it.
+Look through the GitHub issues for features. Anything tagged with “enhancement” +and “help wanted” is open to whoever wants to implement it.
+DecomNano could always use more documentation, whether as part of the +official DecomNano docs, in docstrings, or even on the web in blog posts, +articles, and such.
+The best way to send feedback is to file an issue at https://github.com/Ameyanagi/decomnano/issues.
+If you are proposing a feature:
+Explain in detail how it would work.
Keep the scope as narrow as possible, to make it easier to implement.
Remember that this is a volunteer-driven project, and that contributions +are welcome :)
Ready to contribute? Here’s how to set up decomnano for local development.
+Fork the decomnano repo on GitHub.
Clone your fork locally:
+$ git clone git@github.com:your_name_here/decomnano.git
+
Install your local copy into a virtualenv. Assuming you have conda installed, this is how you set up your fork for local development:
+$ conda create -n decomnano python=3.11
+$ conda activate decomnano
+$ cd decomnano/
+$ pip install -r requirements_dev.txt
+
Create a branch for local development:
+$ git checkout -b name-of-your-bugfix-or-feature
+
Now you can make your changes locally.
+When you’re done making changes, check that your changes pass flake8 and the +tests, including testing other Python versions with tox:
+$ flake8 decomnano tests
+$ python setup.py test or pytest
+$ tox
+
To get flake8 and tox, just pip install them into your virtualenv.
+Commit your changes and push your branch to GitHub:
+$ git add .
+$ git commit -m "Your detailed description of your changes."
+$ git push origin name-of-your-bugfix-or-feature
+
Submit a pull request through the GitHub website.
Before you submit a pull request, check that it meets these guidelines:
+The pull request should include tests.
If the pull request adds functionality, the docs should be updated. Put +your new functionality into a function with a docstring, and add the +feature to the list in README.rst.
The pull request should work for Python 3.8, 3.9, 3.10 and 3.11. Make sure that the tests pass for all supported Python versions.
To run a subset of tests:
+$ pytest tests.test_decomnano
+
A reminder for the maintainers on how to deploy. +Make sure all your changes are committed (including an entry in HISTORY.rst). +Then run:
+$ bump2version patch # possible: major / minor / patch
+$ git push
+$ git push --tags
+
+"""Console script for decomnano."""
+import sys
+import click
+from .decomnano import DecomNano
+from .sweep import SweepDecomNano
+import toml
+import numpy as np
+
+
+[docs]def parse_array_in_config(config_dict):
+ """Parse array in config file to numpy array."""
+
+ if "input_config" not in config_dict:
+ return config_dict
+
+ for key, value in config_dict["input_config"].items():
+ if isinstance(value, dict):
+ config_dict["input_config"][key] = np.arange(
+ value["start"],
+ value["end"],
+ value["step"],
+ )
+
+ return config_dict
+
+
+[docs]def run_sweep(config_dict=None, output="result.csv", interval=100):
+ """Run SweepDecomNano with config_dict."""
+
+ config_dict = parse_array_in_config(config_dict)
+
+ sd = SweepDecomNano(
+ input_default=config_dict["input"],
+ input_config=config_dict["input_config"],
+ )
+ sd.calc_sweep(savepath=output, save_interval=interval)
+
+
+[docs]def run_decomnano(config_dict=None, output="result.csv"):
+ """Run DecomNano with config_dict."""
+
+ config_dict = parse_array_in_config(config_dict)
+
+ dn = DecomNano(
+ input=dict(config_dict["input"]),
+ )
+ df = dn.solve_decomnano()
+ df.to_csv(output)
+
+
+@click.command()
+@click.option(
+ "-s",
+ "--sweep",
+ type=bool,
+ default=False,
+ required=False,
+ help="Sweep over a range of values.",
+)
+@click.option(
+ "-c",
+ "--config",
+ type=str,
+ default=None,
+ required=None,
+ help="Path to config file.",
+)
+@click.option(
+ "-o",
+ "--output",
+ type=str,
+ default="result.csv",
+ required=False,
+ help="Path to output file.",
+)
+@click.option(
+ "-i",
+ "--interval",
+ type=int,
+ default=100,
+ required=False,
+ help="Interval of printing results in sweep.",
+)
+def main(sweep, config, output, interval):
+ """Console script for DecomNano.\n
+ DecomNano is a heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.\n
+ """
+ if config is None:
+ raise ValueError("Please specify config file.")
+
+ config_dict = toml.load(config)
+
+ if output is not None:
+ output_filepath = output
+ elif "output" in config_dict.keys():
+ output_filepath = config_dict["output"]
+ else:
+ print("No output file specified. Using default output file: result.csv")
+
+ if sweep or config_dict["sweep"]:
+ run_sweep(config_dict, output_filepath, interval=interval)
+ else:
+ run_decomnano(config_dict, output_filepath)
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main()) # pragma: no cover
+
+"""Main module."""
+
+from wolframclient.evaluation import WolframLanguageSession
+from wolframclient.language import wl, wlexpr
+import re
+import pandas as pd
+import os
+
+current_dir = os.path.dirname(os.path.abspath(__file__))
+
+
+[docs]class DecomNano(object):
+ r"""DecomNano class for solving the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+
+ Args:
+ wolfram_kernel (str): Path to the Wolfram kernel. Defaults to None, which searches system default.
+ input (dict): Input dictionary for the heterogeneity analysis. Defaults are {"dP": 2.77, "dA": 2.88, "fA": 0.2, "nAA": 6.5, "nPP": 9.9, "nAP": 0.6, "nPA": 1.13, "DA": 0, "DAP": 18, "DP": 5}.
+
+ Attributes:
+ session (WolframLanguageSession): Wolfram Language session
+ input (dict): Input dictionary for the heterogeneity analysis. Defaults are {"dP": 2.77, "dA": 2.88, "fA": 0.2, "nAA": 6.5, "nPP": 9.9, "nAP": 0.6, "nPA": 1.13, "DA": 0, "DAP": 18, "DP": 5}.
+ results (pd.DataFrame): Results of the heterogeneity analysis
+ column (list): Column names of the results
+ dict_regex (re.Pattern): Regular expression for converting the mathematica results to a dictionary
+
+ Note:
+ The variables in the input dictionary different from the paper due to the naming rules of python. Following table shows the correspondence between the variables in the paper and the input dictionary.
+
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ | Notation in paper | Keys | Descriptions |
+ +===========================================+============+=======================================================================+
+ |:math:`d_P` | dP | Interatomic spacing of Pt nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`d_A` | dA | Interatomic spacing of Au nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`\frac{M_A}{M_A + M_P}` | fA | Molar fraction of Au |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-A}` | nAA | Total first nearest neighbor coordination number of Au-Au bonds. |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-P}` | nPP | Total first nearest neighbor coordination number of Pt-Pt bonds. |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-P}` | nAP | Total first nearest neighbor coordination number of Au-Pt bonds. |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-A}` | nPA | Total first nearest neighbor coordination number of Pt-Au bonds. |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`D_A` | DA | Diameter of Au nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`D_{AP}` | DAP | Diameter of PtAu nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`D_P` | DP | Diameter of Pt nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-M,AP}` | nAM_AP | First nearest neighbor coordination number of Au-metal bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-M,AP}` | nPM_AP | First nearest neighbor coordination number of Pt-metal bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-A,AP}` | nAA_AP | First nearest neighbor coordination number of Au-Au bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-P,AP}` | nAP_AP | First nearest neighbor coordination number of Au-Pt bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-A,AP}` | nPA_AP | First nearest neighbor coordination number of Pt-Au bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-P,AP}` | nPP_AP | First nearest neighbor coordination number of Pt-Pt bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`X_A` | XA | Molar ratio of Au nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`X_{AP}` | XAP | Molar ratio of PtAu nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`X_P` | XP | Molar ratio of Pt nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`y` | y | Molar fraction of Au in PtAu nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ """
+
+ """Template for the function call in Mathematica"""
+ decomnano_equation = (
+ "DecomNano[{dP}, {dA}, {fA}, {nAA}, {nPP}, {nAP}, {nPA}, {DA}, {DAP}, {DP}]"
+ )
+
+ def __init__(self, wolfram_kernel=None, input=None):
+ self.session = WolframLanguageSession(kernel=wolfram_kernel)
+ self.session.evaluate(wl.Get(os.path.join(current_dir, "DecomNano.wl")))
+ self.results = pd.DataFrame()
+ self.dict_regex = re.compile(r"Rule\[Global`(.*?), (.*?)]")
+
+ self.column = [
+ "dP",
+ "dA",
+ "fA",
+ "nAA",
+ "nPP",
+ "nAP",
+ "nPA",
+ "DA",
+ "DAP",
+ "DP",
+ "nAM_AP",
+ "nPM_AP",
+ "nAA_AP",
+ "nAP_AP",
+ "nPA_AP",
+ "nPP_AP",
+ "XAP",
+ "XA",
+ "XP",
+ "y",
+ ]
+
+ self.input = dict(
+ dP=2.77,
+ dA=2.88,
+ fA=0.2,
+ nAA=6.5,
+ nPP=9.9,
+ nAP=0.6,
+ nPA=1.13,
+ DA=0,
+ DAP=18,
+ DP=5,
+ )
+
+ if input is not None:
+ self.input.update(input)
+
+[docs] def init_input(self, **kwargs):
+ """Initialize the input dictionary of DecomNano class.
+
+ Args:
+ **kwargs: Keyword arguments for the input dictionary. Defaults are {"dP": 2.77, "dA": 2.88, "fA": 0.2, "nAA": 6.5, "nPP": 9.9, "nAP": 0.6, "nPA": 1.13, "DA": 0, "DAP": 18, "DP": 5}.
+
+ Examples:
+ >>> dn = DecomNano()
+ >>> dn.init_input(RPt=2.77, RAu=2.88, fAu=0.2, nAuAu=6.5, nPtPt=9.9, nAuPt=0.6, nPtAu=1.13, DA=0, DAP=18, DP=5)
+ """
+ self.input = dict(
+ dP=2.77,
+ dA=2.88,
+ fA=0.2,
+ nAA=6.5,
+ nPP=9.9,
+ nAP=0.6,
+ nPA=1.13,
+ DA=0,
+ DAP=18,
+ DP=5,
+ )
+
+ self.input.update(kwargs)
+
+[docs] def calc_decomnano(self, **kwargs):
+ """Initialize and solve the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+
+ Args:
+ **kwargs: Keyword arguments for the input dictionary. Defaults are {"dP": 2.77, "dA": 2.88, "fA": 0.2, "nAA": 6.5, "nPP": 9.9, "nAP": 0.6, "nPA": 1.13, "DA": 0, "DAP": 18, "DP": 5}.
+
+ Examples:
+ >>> dn = DecomNano()
+ >>> dn.calc_decomnano(RPt=2.77, RAu=2.88, fAu=0.2, nAuAu=6.5, nPtPt=9.9, nAuPt=0.6, nPtAu=1.13, DA=0, DAP=18, DP=5)
+ """
+ self.input.update(**kwargs)
+ # if self.check_duplicate_input():
+ # return
+
+ self.solve_decomnano()
+
+[docs] def print_input(self):
+ """Prints the input dictionary of DecomNano class."""
+ print(self.input)
+
+[docs] def solve_decomnano(self):
+ """Solves the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis."""
+
+ result = self.session.evaluate(
+ wlexpr(self.decomnano_equation.format(**self.input))
+ )
+
+ df = pd.DataFrame(result, columns=self.column)
+ self.results = pd.concat([self.results, df])
+
+ return df
+
+[docs] def check_duplicate_input(self):
+ """Checks if the input dictionary is already solved.
+
+ Returns:
+ bool: True if the input dictionary is already solved, False otherwise.
+ """
+
+ if len(self.results) == 0:
+ return False
+
+ input_df = pd.Series(self.input)
+ input_columns = input_df.index
+
+ df = self.results[input_columns] == input_df
+ df = df.all(axis=1)
+ df = df.any()
+
+ if df:
+ return True
+ else:
+ return False
+
+[docs] def convert_dict(self, result):
+ """Helper function to convert the result of WolframLanguageSession.evaluate() to a dictionary.
+
+ Returns:
+ dict: Dictionary of the result.
+ """
+ dict_result = re.findall(self.dict_regex, str(result))
+ dict_result = dict(dict_result)
+ return dict_result
+
+[docs] def print_results(self):
+ """Prints the results of the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis."""
+ print(self.results)
+
+[docs] def save_results(self, filename="results.csv"):
+ """Saves the results of the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+
+ Args:
+ filename (str): Filename of the results. Defaults to "results.csv".
+ """
+ self.results.to_csv(filename, index=False)
+
+[docs] def load_results(self, filename="results.csv"):
+ """Loads the results to the DecomNano class.
+
+ Args:
+ filename (str): Filename of the results. Defaults to "results.csv".
+ """
+
+ if not os.path.exists(filename):
+ return
+ self.results = pd.read_csv(filename)
+
+[docs] def terminate(self):
+ """Terminates the WolframLanguageSession."""
+ self.session.terminate()
+
+ def __del__(self):
+ """Destructor of DecomNano class. Makes sure that the WolframLanguageSession is terminated."""
+ self.terminate()
+
+from decomnano import DecomNano
+import numpy as np
+import itertools
+
+
+[docs]class SweepDecomNano(object):
+ r"""SweepDecomNano class for calculating decomnano with various input parameters.
+
+ Args:
+ wolfam_kernel (str): Path to the Wolfram kernel. Defaults to None, which uses the default kernel.
+
+ Attributes:
+ dn (DecomNano): DecomNano class for calculating decomnano.
+ input (dict): Current input parameters used for calculating DecomNano solver.
+ input_default (dict): Default input parameters used for calculating DecomNano solver. input will be generated by updating input_default with input_config.
+ input_config (dict): Configuration of input range parameters used for calculating DecomNano solver. input_default will be generated by updating input_default with range specified in input_config. The range of input parameters can be specified by list or numpy array. If the range is specified by list or numpy array, the input parameters varies from the minimum value to the maximum value with the step size of the difference between the maximum value and the minimum value divided by the number of elements in the list or numpy array minus 1. If the range is specified by a single value, the input parameters will be varied from range(input_default-value, input_default+value, resolution). The resolution is set to 0.1 by default.
+
+ Examples:
+ >>> from decomnano import SweepDecomNano
+ >>> sd = SweepDecomNano()
+ >>> sd.calc_sweep("sweep_results")
+ >>> Pt40Au60BP1_input_default = dict(
+ RPt = 2.77,
+ RAu = 2.88,
+ fAu = 0.6,
+ nAuAu = 4.2,
+ nPtPt = 10.0,
+ nAuPt = 2.8,
+ nPtAu = 0.71,
+ DA = 10,
+ DAP = 17,
+ DP = 17,
+ )
+ >>> Pt40Au60BP1_input_config = dict(
+ nAuAu = 0.6,
+ nPtPt = 0.7,
+ nAuPt = 0.5,
+ nPtAu = 0.8,
+ DP = list(range(0, 18, 2)),
+ DA = list(range(0, 18, 2))
+ )
+ >>> sd.update_input_default(Pt40Ag60BP1_input_default)
+ >>> sd.update_input_config(Pt40Ag60BP1_input_config)
+ >>> sd.calc_sweep("sweep_results.csv")
+
+ Note:
+ The variables in the input dictionary different from the paper due to the naming rules of python. Following table shows the correspondence between the variables in the paper and the input dictionary.
+
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ | Notation in paper | Keys | Descriptions |
+ +===========================================+============+=======================================================================+
+ |:math:`d_P` | dP | Interatomic spacing of Pt nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`d_A` | dA | Interatomic spacing of Au nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`\frac{M_A}{M_A + M_P}` | fA | Molar fraction of Au |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-A}` | nAA | Total first nearest neighbor coordination number of Au-Au bonds. |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-P}` | nPP | Total first nearest neighbor coordination number of Pt-Pt bonds. |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-P}` | nAP | Total first nearest neighbor coordination number of Au-Pt bonds. |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-A}` | nPA | Total first nearest neighbor coordination number of Pt-Au bonds. |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`D_A` | DA | Diameter of Au nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`D_{AP}` | DAP | Diameter of PtAu nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`D_P` | DP | Diameter of Pt nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-M,AP}` | nAM_AP | First nearest neighbor coordination number of Au-metal bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-M,AP}` | nPM_AP | First nearest neighbor coordination number of Pt-metal bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-A,AP}` | nAA_AP | First nearest neighbor coordination number of Au-Au bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{A-P,AP}` | nAP_AP | First nearest neighbor coordination number of Au-Pt bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-A,AP}` | nPA_AP | First nearest neighbor coordination number of Pt-Au bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`n_{P-P,AP}` | nPP_AP | First nearest neighbor coordination number of Pt-Pt bonds |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`X_A` | XA | Molar ratio of Au nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`X_{AP}` | XAP | Molar ratio of PtAu nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`X_P` | XP | Molar ratio of Pt nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ |:math:`y` | y | Molar fraction of Au in PtAu nanoparticles |
+ +-------------------------------------------+------------+-----------------------------------------------------------------------+
+ """
+
+ def __init__(self, wolfram_kernel=None, input_default=None, input_config=None):
+ self.dn = DecomNano(wolfram_kernel=wolfram_kernel)
+ self.init_input(input_default=input_default, input_config=input_config)
+ self.calc_input_range()
+
+[docs] def init_input(self, input_default=None, input_config=None):
+ """Initialize input parameters for calculating DecomNano solver. Called in __init__()."""
+ self.input = dict(
+ dP=2.77,
+ dA=2.88,
+ fA=0.8,
+ nAA=6.5,
+ nPP=9.9,
+ nAP=0.6,
+ nPA=1.13,
+ DA=0,
+ DAP=18,
+ DP=5,
+ )
+
+ self.input_default = dict(
+ dP=2.77,
+ dA=2.88,
+ fA=0.8,
+ nAA=6.5,
+ nPP=9.9,
+ nAP=0.6,
+ nPA=1.13,
+ DA=10,
+ DAP=18,
+ DP=18,
+ )
+
+ if input_default is not None:
+ self.input_default.update(input_default)
+
+ if input_config is None:
+ self.input_config = dict(
+ nAA=0.5,
+ nPP=0.7,
+ nAP=0.5,
+ nPA=0.8,
+ DA=list(range(11)),
+ )
+ else:
+ self.input_config = input_config
+
+[docs] def update_input_default(self, input_default, resolution=0.1):
+ """Update input_default and calculate input_range. Copies input_default to self.input_default and calculates input_range.
+
+ Args:
+ input_default (dict): Dictionary to replace input_default.
+ resolution (float): Resolution of input_range. Defaults to 0.1. input_default will be generated by updating input_default with range specified in input_config. The range of input parameters can be specified by list or numpy array. If the range is specified by list or numpy array, the input parameters varies from the minimum value to the maximum value with the step size of the difference between the maximum value and the minimum value divided by the number of elements in the list or numpy array minus 1. If the range is specified by a single value, the input parameters will be varied from range(input_default-value, input_default+value, resolution). The resolution is set to 0.1 by default.
+ """
+ self.input_default = input_default.copy()
+ self.calc_input_range(resolution=resolution)
+
+[docs] def update_input_config(self, input_config, resolution=0.1):
+ """Update input_config and calculate input_range. Copies input_config to self.input_config and calculates input_range.
+
+ Args:
+ input_config (dict): Dictionary to replace input_config.
+ resolution (float): Resolution of input_range. Defaults to 0.1. input_default will be generated by updating input_default with range specified in input_config. The range of input parameters can be specified by list or numpy array. If the range is specified by list or numpy array, the input parameters varies from the minimum value to the maximum value with the step size of the difference between the maximum value and the minimum value divided by the number of elements in the list or numpy array minus 1. If the range is specified by a single value, the input parameters will be varied from range(input_default-value, input_default+value, resolution). The resolution is set to 0.1 by default.
+ """
+ self.input_config = input_config.copy()
+ self.calc_input_range(resolution=resolution)
+
+[docs] def update_input_from_list(self, input_list, label=None):
+ """Update input from list.
+
+ Args:
+ input_list (list): List of input parameters.
+ label (list): List of labels for input parameters. Defaults to None. If label is None, the order of input parameters should be the same as the order of input parameters in self.input. If label is not None, the order of input parameters should be the same as the order of labels.
+ """
+
+ if label is not None:
+ for i in range(len(input_list)):
+ self.input[label[i]] = input_list[i]
+ else:
+ keys = list(self.input.keys())
+ for i in range(len(self.input)):
+ self.input[keys[i]] = input_list[i]
+
+[docs] def update_input(self, input_dict):
+ """Update input from dictionary.
+
+ Args:
+ input_dict (dict): Dictionary of input parameters.
+ """
+ self.input.update(input_dict)
+
+[docs] def calc_input_range(self, resolution=0.1):
+ """Calculate input_range from input_default and input_config.
+
+ Args:
+ resolution (float): Resolution of input_range. Defaults to 0.1. input_default will be generated by updating input_default with range specified in input_config. The range of input parameters can be specified by list or numpy array. If the range is specified by list or numpy array, the input parameters varies from the minimum value to the maximum value with the step size of the difference between the maximum value and the minimum value divided by the number of elements in the list or numpy array minus 1. If the range is specified by a single value, the input parameters will be varied from range(input_default-value, input_default+value, resolution). The resolution is set to 0.1 by default.
+ """
+
+ input_range = {}
+
+ for key in self.input_default:
+ input_range[key] = np.array([self.input_default[key]])
+
+ for key in self.input_config:
+ if type(self.input_config[key]) == list:
+ input_range[key] = self.input_config[key]
+ elif type(self.input_config[key]) == np.ndarray:
+ input_range[key] = self.input_config[key]
+ elif type(self.input_config[key]) == float:
+ input_range[key] = np.round(
+ np.arange(
+ self.input_default[key] - self.input_config[key],
+ self.input_default[key] + self.input_config[key] + 0.1,
+ resolution,
+ ),
+ decimals=2,
+ )
+ elif type(self.input_config[key]) == int:
+ input_range[key] = np.arange(
+ self.input_default[key] - self.input_config[key],
+ self.input_default[key] + self.input_config[key] + 1,
+ )
+ else:
+ pass
+
+ self.input_range = input_range.copy()
+
+
+
+[docs] def calc_sweep(self, savepath="result.csv", save_interval=100):
+ """Calculate DecomNano solver with sweep of input parameters.
+
+ Args:
+ savepath (str): Path to save results. Defaults to "result.csv".
+ save_interval (int): Interval of saving results. The results will be saved after each save_interval. Defaults to 100.
+ """
+
+ labels = list(self.input_range.keys())
+
+ input_range_list = []
+
+ for key in labels:
+ input_range_list.append(self.input_range[key])
+
+ input_iteration = itertools.product(*input_range_list)
+
+ num = 0
+ for input in input_iteration:
+ self.update_input_from_list(input, labels)
+ self.dn.calc_decomnano(**self.input)
+
+ num = num % save_interval
+
+ if num == 0:
+ self.dn.print_input()
+ self.dn.save_results(savepath)
+
+ num = num + 1
+
+ self.dn.print_input()
+ self.dn.save_results(savepath)
+
+[docs] def calc_sweep_const_2param(
+ self, parameters=["DA", "DP"], savepath="result.csv", save_interval=100
+ ):
+ """Calculate DecomNano solver with sweep of input parameters with constraining two parameters to be the same.
+
+ Args:
+ parameters (list): List of two parameters to be constrained to be the same. Defaults to ["DA", "DP"]. Input config of the first parameter will be applied to the second parameter.
+ savepath (str): Path to save results. Defaults to "result.csv".
+ save_interval (int): Interval of saving results. The results will be saved after each save_interval. Defaults to 100.
+
+ Examples:
+ >>> # To constrain DA = DP, run
+ >>> sd.calc_sweep_const_2param(["DA", "DP"], savepath, save_interval=100)
+ """
+
+ if len(parameters) != 2:
+ raise ValueError("parameters should be a list of two strings")
+
+ labels = list(self.input_range.keys())
+
+ # remove parameter[1] from labels
+ labels.remove(parameters[1])
+ index_param0 = labels.index(parameters[0])
+
+ input_range_list = []
+
+ for key in labels:
+ input_range_list.append(self.input_range[key])
+
+ input_iteration = itertools.product(*input_range_list)
+
+ num = 0
+ for input in input_iteration:
+ self.update_input_from_list(input, labels)
+
+ # update input to constrain parameters[1] to be the same as parameters[0]
+ self.update_input({parameters[1]: input[index_param0]})
+ self.dn.calc_decomnano(**self.input)
+
+ num = num % save_interval
+
+ if num == 0:
+ self.dn.print_input()
+ self.dn.save_results(savepath)
+
+ num = num + 1
+
+ self.dn.print_input()
+ self.dn.save_results(savepath)
+
+
+
+ def __del__(self):
+ """Terminate DecomNano solver."""
+ self.terminate()
+
' + + '' + + _("Hide Search Matches") + + "
" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(SphinxHighlight.highlightSearchWords); +_ready(SphinxHighlight.initEscapeListener); diff --git a/html/authors.html b/html/authors.html new file mode 100644 index 0000000..82dc5e1 --- /dev/null +++ b/html/authors.html @@ -0,0 +1,136 @@ + + + + + + +Ryuichi Shimogawa <ryuichi.shimogawa@stonybrook.edu>
Maichong Xie
Anatoly I. Frenekel
Marc R.Knecht
Contributions are welcome, and they are greatly appreciated! Every little bit +helps, and credit will always be given.
+You can contribute in many ways:
+Report bugs at https://github.com/Ameyanagi/decomnano/issues.
+If you are reporting a bug, please include:
+Your operating system name and version.
Any details about your local setup that might be helpful in troubleshooting.
Detailed steps to reproduce the bug.
Look through the GitHub issues for bugs. Anything tagged with “bug” and “help +wanted” is open to whoever wants to implement it.
+Look through the GitHub issues for features. Anything tagged with “enhancement” +and “help wanted” is open to whoever wants to implement it.
+DecomNano could always use more documentation, whether as part of the +official DecomNano docs, in docstrings, or even on the web in blog posts, +articles, and such.
+The best way to send feedback is to file an issue at https://github.com/Ameyanagi/decomnano/issues.
+If you are proposing a feature:
+Explain in detail how it would work.
Keep the scope as narrow as possible, to make it easier to implement.
Remember that this is a volunteer-driven project, and that contributions +are welcome :)
Ready to contribute? Here’s how to set up decomnano for local development.
+Fork the decomnano repo on GitHub.
Clone your fork locally:
+$ git clone git@github.com:your_name_here/decomnano.git
+
Install your local copy into a virtualenv. Assuming you have conda installed, this is how you set up your fork for local development:
+$ conda create -n decomnano python=3.11
+$ conda activate decomnano
+$ cd decomnano/
+$ pip install -r requirements_dev.txt
+
Create a branch for local development:
+$ git checkout -b name-of-your-bugfix-or-feature
+
Now you can make your changes locally.
+When you’re done making changes, check that your changes pass flake8 and the +tests, including testing other Python versions with tox:
+$ flake8 decomnano tests
+$ python setup.py test or pytest
+$ tox
+
To get flake8 and tox, just pip install them into your virtualenv.
+Commit your changes and push your branch to GitHub:
+$ git add .
+$ git commit -m "Your detailed description of your changes."
+$ git push origin name-of-your-bugfix-or-feature
+
Submit a pull request through the GitHub website.
Before you submit a pull request, check that it meets these guidelines:
+The pull request should include tests.
If the pull request adds functionality, the docs should be updated. Put +your new functionality into a function with a docstring, and add the +feature to the list in README.rst.
The pull request should work for Python 3.8, 3.9, 3.10 and 3.11. Make sure that the tests pass for all supported Python versions.
To run a subset of tests:
+$ pytest tests.test_decomnano
+
A reminder for the maintainers on how to deploy. +Make sure all your changes are committed (including an entry in HISTORY.rst). +Then run:
+$ bump2version patch # possible: major / minor / patch
+$ git push
+$ git push --tags
+
Console script for decomnano.
+Parse array in config file to numpy array.
+Main module.
+Bases: object
DecomNano class for solving the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+wolfram_kernel (str) – Path to the Wolfram kernel. Defaults to None, which searches system default.
input (dict) – Input dictionary for the heterogeneity analysis. Defaults are {“dP”: 2.77, “dA”: 2.88, “fA”: 0.2, “nAA”: 6.5, “nPP”: 9.9, “nAP”: 0.6, “nPA”: 1.13, “DA”: 0, “DAP”: 18, “DP”: 5}.
Wolfram Language session
+WolframLanguageSession
+Input dictionary for the heterogeneity analysis. Defaults are {“dP”: 2.77, “dA”: 2.88, “fA”: 0.2, “nAA”: 6.5, “nPP”: 9.9, “nAP”: 0.6, “nPA”: 1.13, “DA”: 0, “DAP”: 18, “DP”: 5}.
+dict
+Results of the heterogeneity analysis
+pd.DataFrame
+Column names of the results
+list
+Regular expression for converting the mathematica results to a dictionary
+re.Pattern
+Note
+The variables in the input dictionary different from the paper due to the naming rules of python. Following table shows the correspondence between the variables in the paper and the input dictionary.
+Notation in paper |
+Keys |
+Descriptions |
+
---|---|---|
\(d_P\) |
+dP |
+Interatomic spacing of Pt nanoparticles |
+
\(d_A\) |
+dA |
+Interatomic spacing of Au nanoparticles |
+
\(\frac{M_A}{M_A + M_P}\) |
+fA |
+Molar fraction of Au |
+
\(n_{A-A}\) |
+nAA |
+Total first nearest neighbor coordination number of Au-Au bonds. |
+
\(n_{P-P}\) |
+nPP |
+Total first nearest neighbor coordination number of Pt-Pt bonds. |
+
\(n_{A-P}\) |
+nAP |
+Total first nearest neighbor coordination number of Au-Pt bonds. |
+
\(n_{P-A}\) |
+nPA |
+Total first nearest neighbor coordination number of Pt-Au bonds. |
+
\(D_A\) |
+DA |
+Diameter of Au nanoparticles |
+
\(D_{AP}\) |
+DAP |
+Diameter of PtAu nanoparticles |
+
\(D_P\) |
+DP |
+Diameter of Pt nanoparticles |
+
\(n_{A-M,AP}\) |
+nAM_AP |
+First nearest neighbor coordination number of Au-metal bonds |
+
\(n_{P-M,AP}\) |
+nPM_AP |
+First nearest neighbor coordination number of Pt-metal bonds |
+
\(n_{A-A,AP}\) |
+nAA_AP |
+First nearest neighbor coordination number of Au-Au bonds |
+
\(n_{A-P,AP}\) |
+nAP_AP |
+First nearest neighbor coordination number of Au-Pt bonds |
+
\(n_{P-A,AP}\) |
+nPA_AP |
+First nearest neighbor coordination number of Pt-Au bonds |
+
\(n_{P-P,AP}\) |
+nPP_AP |
+First nearest neighbor coordination number of Pt-Pt bonds |
+
\(X_A\) |
+XA |
+Molar ratio of Au nanoparticles |
+
\(X_{AP}\) |
+XAP |
+Molar ratio of PtAu nanoparticles |
+
\(X_P\) |
+XP |
+Molar ratio of Pt nanoparticles |
+
\(y\) |
+y |
+Molar fraction of Au in PtAu nanoparticles |
+
Initialize and solve the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+**kwargs – Keyword arguments for the input dictionary. Defaults are {“dP”: 2.77, “dA”: 2.88, “fA”: 0.2, “nAA”: 6.5, “nPP”: 9.9, “nAP”: 0.6, “nPA”: 1.13, “DA”: 0, “DAP”: 18, “DP”: 5}.
+Examples
+>>> dn = DecomNano()
+>>> dn.calc_decomnano(RPt=2.77, RAu=2.88, fAu=0.2, nAuAu=6.5, nPtPt=9.9, nAuPt=0.6, nPtAu=1.13, DA=0, DAP=18, DP=5)
+
Checks if the input dictionary is already solved.
+True if the input dictionary is already solved, False otherwise.
+bool
+Helper function to convert the result of WolframLanguageSession.evaluate() to a dictionary.
+Dictionary of the result.
+dict
+Initialize the input dictionary of DecomNano class.
+**kwargs – Keyword arguments for the input dictionary. Defaults are {“dP”: 2.77, “dA”: 2.88, “fA”: 0.2, “nAA”: 6.5, “nPP”: 9.9, “nAP”: 0.6, “nPA”: 1.13, “DA”: 0, “DAP”: 18, “DP”: 5}.
+Examples
+>>> dn = DecomNano()
+>>> dn.init_input(RPt=2.77, RAu=2.88, fAu=0.2, nAuAu=6.5, nPtPt=9.9, nAuPt=0.6, nPtAu=1.13, DA=0, DAP=18, DP=5)
+
Loads the results to the DecomNano class.
+filename (str) – Filename of the results. Defaults to “results.csv”.
+Prints the results of the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+Saves the results of the heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+filename (str) – Filename of the results. Defaults to “results.csv”.
+Bases: object
SweepDecomNano class for calculating decomnano with various input parameters.
+wolfam_kernel (str) – Path to the Wolfram kernel. Defaults to None, which uses the default kernel.
+Current input parameters used for calculating DecomNano solver.
+dict
+Default input parameters used for calculating DecomNano solver. input will be generated by updating input_default with input_config.
+dict
+Configuration of input range parameters used for calculating DecomNano solver. input_default will be generated by updating input_default with range specified in input_config. The range of input parameters can be specified by list or numpy array. If the range is specified by list or numpy array, the input parameters varies from the minimum value to the maximum value with the step size of the difference between the maximum value and the minimum value divided by the number of elements in the list or numpy array minus 1. If the range is specified by a single value, the input parameters will be varied from range(input_default-value, input_default+value, resolution). The resolution is set to 0.1 by default.
+dict
+Examples
+>>> from decomnano import SweepDecomNano
+>>> sd = SweepDecomNano()
+>>> sd.calc_sweep("sweep_results")
+>>> Pt40Au60BP1_input_default = dict(
+ RPt = 2.77,
+ RAu = 2.88,
+ fAu = 0.6,
+ nAuAu = 4.2,
+ nPtPt = 10.0,
+ nAuPt = 2.8,
+ nPtAu = 0.71,
+ DA = 10,
+ DAP = 17,
+ DP = 17,
+ )
+>>> Pt40Au60BP1_input_config = dict(
+ nAuAu = 0.6,
+ nPtPt = 0.7,
+ nAuPt = 0.5,
+ nPtAu = 0.8,
+ DP = list(range(0, 18, 2)),
+ DA = list(range(0, 18, 2))
+ )
+>>> sd.update_input_default(Pt40Ag60BP1_input_default)
+>>> sd.update_input_config(Pt40Ag60BP1_input_config)
+>>> sd.calc_sweep("sweep_results.csv")
+
Note
+The variables in the input dictionary different from the paper due to the naming rules of python. Following table shows the correspondence between the variables in the paper and the input dictionary.
+Notation in paper |
+Keys |
+Descriptions |
+
---|---|---|
\(d_P\) |
+dP |
+Interatomic spacing of Pt nanoparticles |
+
\(d_A\) |
+dA |
+Interatomic spacing of Au nanoparticles |
+
\(\frac{M_A}{M_A + M_P}\) |
+fA |
+Molar fraction of Au |
+
\(n_{A-A}\) |
+nAA |
+Total first nearest neighbor coordination number of Au-Au bonds. |
+
\(n_{P-P}\) |
+nPP |
+Total first nearest neighbor coordination number of Pt-Pt bonds. |
+
\(n_{A-P}\) |
+nAP |
+Total first nearest neighbor coordination number of Au-Pt bonds. |
+
\(n_{P-A}\) |
+nPA |
+Total first nearest neighbor coordination number of Pt-Au bonds. |
+
\(D_A\) |
+DA |
+Diameter of Au nanoparticles |
+
\(D_{AP}\) |
+DAP |
+Diameter of PtAu nanoparticles |
+
\(D_P\) |
+DP |
+Diameter of Pt nanoparticles |
+
\(n_{A-M,AP}\) |
+nAM_AP |
+First nearest neighbor coordination number of Au-metal bonds |
+
\(n_{P-M,AP}\) |
+nPM_AP |
+First nearest neighbor coordination number of Pt-metal bonds |
+
\(n_{A-A,AP}\) |
+nAA_AP |
+First nearest neighbor coordination number of Au-Au bonds |
+
\(n_{A-P,AP}\) |
+nAP_AP |
+First nearest neighbor coordination number of Au-Pt bonds |
+
\(n_{P-A,AP}\) |
+nPA_AP |
+First nearest neighbor coordination number of Pt-Au bonds |
+
\(n_{P-P,AP}\) |
+nPP_AP |
+First nearest neighbor coordination number of Pt-Pt bonds |
+
\(X_A\) |
+XA |
+Molar ratio of Au nanoparticles |
+
\(X_{AP}\) |
+XAP |
+Molar ratio of PtAu nanoparticles |
+
\(X_P\) |
+XP |
+Molar ratio of Pt nanoparticles |
+
\(y\) |
+y |
+Molar fraction of Au in PtAu nanoparticles |
+
Calculate input_range from input_default and input_config.
+resolution (float) – Resolution of input_range. Defaults to 0.1. input_default will be generated by updating input_default with range specified in input_config. The range of input parameters can be specified by list or numpy array. If the range is specified by list or numpy array, the input parameters varies from the minimum value to the maximum value with the step size of the difference between the maximum value and the minimum value divided by the number of elements in the list or numpy array minus 1. If the range is specified by a single value, the input parameters will be varied from range(input_default-value, input_default+value, resolution). The resolution is set to 0.1 by default.
+Calculate DecomNano solver with sweep of input parameters.
+savepath (str) – Path to save results. Defaults to “result.csv”.
save_interval (int) – Interval of saving results. The results will be saved after each save_interval. Defaults to 100.
Calculate DecomNano solver with sweep of input parameters with constraining two parameters to be the same.
+parameters (list) – List of two parameters to be constrained to be the same. Defaults to [“DA”, “DP”]. Input config of the first parameter will be applied to the second parameter.
savepath (str) – Path to save results. Defaults to “result.csv”.
save_interval (int) – Interval of saving results. The results will be saved after each save_interval. Defaults to 100.
Examples
+>>> # To constrain DA = DP, run
+>>> sd.calc_sweep_const_2param(["DA", "DP"], savepath, save_interval=100)
+
Initialize input parameters for calculating DecomNano solver. Called in __init__().
+Update input from dictionary.
+input_dict (dict) – Dictionary of input parameters.
+Update input_config and calculate input_range. Copies input_config to self.input_config and calculates input_range.
+input_config (dict) – Dictionary to replace input_config.
resolution (float) – Resolution of input_range. Defaults to 0.1. input_default will be generated by updating input_default with range specified in input_config. The range of input parameters can be specified by list or numpy array. If the range is specified by list or numpy array, the input parameters varies from the minimum value to the maximum value with the step size of the difference between the maximum value and the minimum value divided by the number of elements in the list or numpy array minus 1. If the range is specified by a single value, the input parameters will be varied from range(input_default-value, input_default+value, resolution). The resolution is set to 0.1 by default.
Update input_default and calculate input_range. Copies input_default to self.input_default and calculates input_range.
+input_default (dict) – Dictionary to replace input_default.
resolution (float) – Resolution of input_range. Defaults to 0.1. input_default will be generated by updating input_default with range specified in input_config. The range of input parameters can be specified by list or numpy array. If the range is specified by list or numpy array, the input parameters varies from the minimum value to the maximum value with the step size of the difference between the maximum value and the minimum value divided by the number of elements in the list or numpy array minus 1. If the range is specified by a single value, the input parameters will be varied from range(input_default-value, input_default+value, resolution). The resolution is set to 0.1 by default.
Update input from list.
+input_list (list) – List of input parameters.
label (list) – List of labels for input parameters. Defaults to None. If label is None, the order of input parameters should be the same as the order of input parameters in self.input. If label is not None, the order of input parameters should be the same as the order of labels.
Top-level package for DecomNano.
++ | + |
|
+
|
+
+ | + |
+ |
|
+
+ | + |
+ | + |
+ | + |
+ |
+ | + |
To install DecomNano, run this command in your terminal:
+$ pip install decomnano
+
This is the preferred method to install DecomNano, as it will always install the most recent stable release.
+If you don’t have pip installed, this Python installation guide can guide +you through the process.
+The sources for DecomNano can be downloaded from the Github repo.
+You can either clone the public repository:
+$ git clone git://github.com/Ameyanagi/decomnano
+
Or download the tarball:
+$ curl -OJL https://github.com/Ameyanagi/decomnano/tarball/master
+
Once you have a copy of the source, you can install it with:
+$ python setup.py install
+
DecomNano
DecomNano.session
DecomNano.input
DecomNano.results
DecomNano.column
DecomNano.dict_regex
DecomNano.calc_decomnano()
DecomNano.check_duplicate_input()
DecomNano.convert_dict()
DecomNano.decomnano_equation
DecomNano.init_input()
DecomNano.load_results()
DecomNano.print_input()
DecomNano.print_results()
DecomNano.save_results()
DecomNano.solve_decomnano()
DecomNano.terminate()
SweepDecomNano
SweepDecomNano.dn
SweepDecomNano.input
SweepDecomNano.input_default
SweepDecomNano.input_config
SweepDecomNano.calc_input_range()
SweepDecomNano.calc_sweep()
SweepDecomNano.calc_sweep_const_2param()
SweepDecomNano.init_input()
SweepDecomNano.print_input_range()
SweepDecomNano.terminate()
SweepDecomNano.update_input()
SweepDecomNano.update_input_config()
SweepDecomNano.update_input_default()
SweepDecomNano.update_input_from_list()
+ d | ||
+ |
+ decomnano | + |
+ |
+ decomnano.cli | + |
+ |
+ decomnano.decomnano | + |
+ |
+ decomnano.sweep | + |
DecomNano is a heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+Free software: MIT license
Documentation: https://ameyanagi.github.io/DecomNano/index.html.
DecomNano requires Mathematica for solving non-liner equations. Please install Mathematica or Wolfram Engine.n +Other requirements for python can be installed by pip command.
+pip install -r requirements.txt
+
Detailed instructions for installation are available in the installation documentation.
+pip install decomnano
+
pip install git+https://github.com/Ameyanagi/DecomNano
+
or clone the repository and install from local source.
+git clone https://github.com/Ameyanagi/DecomNano
+cd DecomNano
+pip install .
+
Detailed instructions for usage are available in the usage documentation.
+The decomnano package comes with a command line interface (CLI) that can be used to run the analysis. The configuration file can be found in the examples directory. Download the configuration file and run the following command.
+decomnano -c sweep_example.toml -o sweep_results.csv
+
The results will be saved in the sweep_results.csv file.
+Detailed instructions for usage are available in the API documentation. +The decomanano package can be imported and used in python scripts.
+If you use DecomNano in your research, please cite the following paper: to be submitted.
+The decomnano package comes with a command line interface (CLI) that can be used to run the analysis. The configuration file can be found in the examples directory. Download the configuration file and run the following command.
+decomnano -c sweep_example.toml -o sweep_results.csv
+
The results will be saved in the sweep_results.csv file.
+The configuration file is a TOML file. The following parameters can be set in the configuration file.
+# Example configuration file for DecomNano
+
+# Single run is done if sweep is false
+# Sweep is done if sweep is true
+sweep = true
+
+# You can specify the output file name. If not specified, the default name is "results.csv"
+output = "sweep_results.csv"
+
+[input]
+# input section is used for input of DecomNano if sweep is false
+# input section is used for input_default of SweepDecomNano if sweep is true
+dP=2.77
+dA=2.88
+fA=0.8
+nAA=6.2
+nPP=9.8
+nAP=0.5
+nPA=0.53
+DA=0
+DAP=18
+DP=0
+
+[input_config]
+# Input_config section is used for defining the sweep range of each parameter.
+# It is required if sweep is true.
+# It will be ignored if sweep is false.# Accepted types are number, list and dictionary.
+# A dictionary will require start, end and step, and will generate a list of range(start, end, step). end is not included as in range() function in python.
+nAA=0.1
+DAP=[16, 17, 18]
+DA={start=0, end=2, step=1}
+
The variables in the input dictionary different from the paper due to the naming rules of python. Following table shows the correspondence between the variables in the paper and the input dictionary.
++++ +
++ + + + Notation in paper
+ Keys
+ Descriptions
+ + \(d_P\)
+ dP
+ Interatomic spacing of Pt nanoparticles
+ + \(d_A\)
+ dA
+ Interatomic spacing of Au nanoparticles
+ + \(\frac{M_A}{M_A + M_P}\)
+ fA
+ Molar fraction of Au
+ + \(n_{A-A}\)
+ nAA
+ Total first nearest neighbor coordination number of Au-Au bonds.
+ + \(n_{P-P}\)
+ nPP
+ Total first nearest neighbor coordination number of Pt-Pt bonds.
+ + \(n_{A-P}\)
+ nAP
+ Total first nearest neighbor coordination number of Au-Pt bonds.
+ + \(n_{P-A}\)
+ nPA
+ Total first nearest neighbor coordination number of Pt-Au bonds.
+ + \(D_A\)
+ DA
+ Diameter of Au nanoparticles
+ + \(D_{AP}\)
+ DAP
+ Diameter of PtAu nanoparticles
+ + + \(D_P\)
+ DP
+ Diameter of Pt nanoparticles
The decomanano package can be imported and used in python scripts. +Please refer to the API documentation for details.
+To install DecomNano, run this command in your terminal:
+$ pip install decomnano
+
This is the preferred method to install DecomNano, as it will always install the most recent stable release.
+If you don’t have pip installed, this Python installation guide can guide +you through the process.
+The sources for DecomNano can be downloaded from the Github repo.
+You can either clone the public repository:
+$ git clone git://github.com/Ameyanagi/decomnano
+
Or download the tarball:
+$ curl -OJL https://github.com/Ameyanagi/decomnano/tarball/master
+
Once you have a copy of the source, you can install it with:
+$ python setup.py install
+
DecomNano is a heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.
+Free software: MIT license
Documentation: https://ameyanagi.github.io/DecomNano/index.html.
DecomNano requires Mathematica for solving non-liner equations. Please install Mathematica or Wolfram Engine.n +Other requirements for python can be installed by pip command.
+pip install -r requirements.txt
+
Detailed instructions for installation are available in the installation documentation.
+(This method is not available yet. It will be available after the submission.)
+pip install decomnano
+
pip install git+https://github.com/Ameyanagi/DecomNano
+
or clone the repository and install from local source.
+git clone https://github.com/Ameyanagi/DecomNano
+cd DecomNano
+pip install .
+
Detailed instructions for usage are available in the usage documentation.
+The decomnano package comes with a command line interface (CLI) that can be used to run the analysis. The configuration file can be found in the examples directory. Download the configuration file and run the following command.
+decomnano -c sweep_example.toml -o sweep_results.csv
+
The results will be saved in the sweep_results.csv file.
+Detailed instructions for usage are available in the API documentation. +The decomanano package can be imported and used in python scripts.
+If you use DecomNano in your research, please cite the following paper: to be submitted.
+The decomnano package comes with a command line interface (CLI) that can be used to run the analysis. The configuration file can be found in the examples directory. Download the configuration file and run the following command.
+decomnano -c sweep_example.toml -o sweep_results.csv
+
The results will be saved in the sweep_results.csv file.
+The configuration file is a TOML file. The following parameters can be set in the configuration file.
+# Example configuration file for DecomNano
+
+# Single run is done if sweep is false
+# Sweep is done if sweep is true
+sweep = true
+
+# You can specify the output file name. If not specified, the default name is "results.csv"
+output = "sweep_results.csv"
+
+[input]
+# input section is used for input of DecomNano if sweep is false
+# input section is used for input_default of SweepDecomNano if sweep is true
+dP=2.77
+dA=2.88
+fA=0.8
+nAA=6.2
+nPP=9.8
+nAP=0.5
+nPA=0.53
+DA=0
+DAP=18
+DP=0
+
+[input_config]
+# Input_config section is used for defining the sweep range of each parameter.
+# It is required if sweep is true.
+# It will be ignored if sweep is false.# Accepted types are number, list and dictionary.
+# A dictionary will require start, end and step, and will generate a list of range(start, end, step). end is not included as in range() function in python.
+nAA=0.1
+DAP=[16, 17, 18]
+DA={start=0, end=2, step=1}
+
The variables in the input dictionary different from the paper due to the naming rules of python. Following table shows the correspondence between the variables in the paper and the input dictionary.
++++ +
++ + + + Notation in paper
+ Keys
+ Descriptions
+ + \(d_P\)
+ dP
+ Interatomic spacing of Pt nanoparticles
+ + \(d_A\)
+ dA
+ Interatomic spacing of Au nanoparticles
+ + \(\frac{M_A}{M_A + M_P}\)
+ fA
+ Molar fraction of Au
+ + \(n_{A-A}\)
+ nAA
+ Total first nearest neighbor coordination number of Au-Au bonds.
+ + \(n_{P-P}\)
+ nPP
+ Total first nearest neighbor coordination number of Pt-Pt bonds.
+ + \(n_{A-P}\)
+ nAP
+ Total first nearest neighbor coordination number of Au-Pt bonds.
+ + \(n_{P-A}\)
+ nPA
+ Total first nearest neighbor coordination number of Pt-Au bonds.
+ + \(D_A\)
+ DA
+ Diameter of Au nanoparticles
+ + \(D_{AP}\)
+ DAP
+ Diameter of PtAu nanoparticles
+ + + \(D_P\)
+ DP
+ Diameter of Pt nanoparticles
The decomanano package can be imported and used in python scripts. +Please refer to the API documentation for details.
+