-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'update.solver_module' into update
- Loading branch information
Showing
122 changed files
with
2,499 additions
and
95 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# LEED solver module for Py2DMAT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[tool.poetry] | ||
name = "leed" | ||
version = "1.0-dev" | ||
description = "LEED solver module for Py2DMAT: data-analysis software of quantum beam diffraction experiments for 2D material structure" | ||
authors = ["2DMAT developers <[email protected]>"] | ||
license = "GPL-3.0-or-later" | ||
|
||
readme = "README.md" | ||
repository = "https://github.com/issp-center-dev/py2dmat-leed" | ||
|
||
packages = [ | ||
{ include = "leed", from = "src" } | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.6.8" | ||
numpy = "^1.14" | ||
#mpi4py = {version = "^3", optional = true} | ||
py2dmat = "^2" | ||
|
||
#[tool.poetry.extras] | ||
#min_search = ["scipy"] | ||
#bayes = ["physbo"] | ||
#exchange = ["mpi4py"] | ||
#all = ["scipy", "mpi4py", "physbo"] | ||
|
||
#[tool.poetry.dev-dependencies] | ||
#black = "^22.3.0" | ||
#pynvim = "^0.4.3" | ||
|
||
[tool.poetry.scripts] | ||
py2dmat-leed = "leed._main:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .leed import Solver | ||
|
||
__version__ = "1.0-dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# 2DMAT -- Data-analysis software of quantum beam diffraction experiments for 2D material structure | ||
# Copyright (C) 2020- The University of Tokyo | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see http://www.gnu.org/licenses/. | ||
|
||
from sys import exit | ||
|
||
import py2dmat | ||
import py2dmat.mpi | ||
import py2dmat.util.toml | ||
|
||
from leed import Solver | ||
|
||
def main(): | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser( | ||
description=( | ||
"Data-analysis software of quantum beam " | ||
"diffraction experiments for 2D material structure" | ||
) | ||
) | ||
parser.add_argument("inputfile", help="input file with TOML format") | ||
parser.add_argument("--version", action="version", version=py2dmat.__version__) | ||
|
||
args = parser.parse_args() | ||
|
||
file_name = args.inputfile | ||
inp = {} | ||
if py2dmat.mpi.rank() == 0: | ||
inp = py2dmat.util.toml.load(file_name) | ||
if py2dmat.mpi.size() > 1: | ||
inp = py2dmat.mpi.comm().bcast(inp, root=0) | ||
info = py2dmat.Info(inp) | ||
|
||
algname = info.algorithm["name"] | ||
if algname == "mapper": | ||
from py2dmat.algorithm.mapper_mpi import Algorithm | ||
elif algname == "minsearch": | ||
from py2dmat.algorithm.min_search import Algorithm | ||
elif algname == "exchange": | ||
from py2dmat.algorithm.exchange import Algorithm | ||
elif algname == "pamc": | ||
from py2dmat.algorithm.pamc import Algorithm | ||
elif algname == "bayes": | ||
from py2dmat.algorithm.bayes import Algorithm | ||
else: | ||
print(f"ERROR: Unknown algorithm ({algname})") | ||
exit(1) | ||
|
||
solver = Solver(info) | ||
runner = py2dmat.Runner(solver, info) | ||
alg = Algorithm(info, runner) | ||
alg.main() | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.