From f5f3f2d2f513efb51f73187f4cb4a0976f1de024 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Tue, 12 Jul 2022 20:31:31 +0800 Subject: [PATCH] 0.0.105 --- API_Reference.py | 4 ++++ PyPI/setup.cfg | 2 +- PyPI/src/guan/__init__.py | 26 +++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/API_Reference.py b/API_Reference.py index 6da5119..24fc466 100644 --- a/API_Reference.py +++ b/API_Reference.py @@ -282,6 +282,10 @@ guan.make_gif(image_path_array, filename='a', duration=0.1) parameter_array = guan.preprocess_for_parallel_calculations(parameter_array_all, cpus=1, task_index=0) +new_array = guan.find_close_values_in_one_array(array, precision=1e-2) + +degenerate_k_array, degenerate_eigenvalue_array = guan.find_degenerate_points(k_array, eigenvalue_array, precision=1e-2) + guan.change_directory_by_replacement(current_key_word='code', new_key_word='data') guan.batch_reading_and_plotting(directory, xlabel='x', ylabel='y') diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index d7ff938..c497f3d 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.0.103 +version = 0.0.105 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan/__init__.py b/PyPI/src/guan/__init__.py index 40d4de0..1781749 100644 --- a/PyPI/src/guan/__init__.py +++ b/PyPI/src/guan/__init__.py @@ -2,7 +2,7 @@ # With this package, you can calculate band structures, density of states, quantum transport and topological invariant of tight-binding models by invoking the functions you need. Other frequently used functions are also integrated in this package, such as file reading/writing, figure plotting, data processing. -# The current version is guan-0.0.103, updated on July 06, 2022. +# The current version is guan-0.0.105, updated on July 12, 2022. # Installation: pip install --upgrade guan @@ -1902,6 +1902,30 @@ def preprocess_for_parallel_calculations(parameter_array_all, cpus=1, task_index parameter_array = parameter_array_all[task_index*num_parameter:num_all] return parameter_array +def find_close_values_in_one_array(array, precision=1e-2): + new_array = [] + i0 = 0 + for a1 in array: + j0 = 0 + for a2 in array: + if j0>i0 and abs(a1-a2)