├── .chglog ├── CHANGELOG.tpl.md └── config.yml ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md └── workflows │ ├── codeql.yml │ ├── python-publish.yml │ └── test.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── CHANGELOG.md ├── CITATION.cff ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── benchmarks ├── bench_build.py ├── bench_build_memory.png ├── bench_build_time.png └── bench_periodic_time.png ├── docs ├── Makefile ├── make.bat └── source │ ├── .gitignore │ ├── _static │ ├── example_square_periodic.png │ └── header.png │ ├── _templates │ ├── apidoc │ │ ├── module.rst_t │ │ ├── package.rst_t │ │ └── toc.rst_t │ └── autosummary │ │ ├── class.rst │ │ └── module.rst │ ├── conf.py │ ├── development │ ├── changes.md │ └── contributing.md │ ├── index.rst │ ├── installation.rst │ ├── lattpy.rst │ ├── quickstart.rst │ ├── requirements.txt │ └── tutorial │ ├── configuration.rst │ ├── finite.rst │ ├── general.rst │ └── index.rst ├── lattpy ├── __init__.py ├── atom.py ├── basis.py ├── data.py ├── disptools.py ├── lattice.py ├── plotting.py ├── shape.py ├── spatial.py ├── structure.py ├── tests │ ├── __init__.py │ ├── test_atom.py │ ├── test_basis.py │ ├── test_data.py │ ├── test_lattice.py │ ├── test_shape.py │ ├── test_spatial.py │ ├── test_structure.py │ └── test_utils.py └── utils.py ├── lgtm.yml ├── pyproject.toml ├── requirements.txt ├── setup.cfg └── setup.py /.chglog/CHANGELOG.tpl.md: -------------------------------------------------------------------------------- 1 | # What's New 2 | 3 | {{ if .Versions -}} 4 | 5 | 6 | ## [Unreleased] 7 | 8 | {{ if .Unreleased.CommitGroups -}} 9 | {{ range .Unreleased.CommitGroups -}} 10 | ### {{ .Title }} 11 | {{ range .Commits -}} 12 | - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} 13 | {{ end }} 14 | {{ end -}} 15 | {{ end -}} 16 | {{ end -}} 17 | 18 | {{ range .Versions }} 19 | {{- if not (eq .Tag.Name "0.6.0" "0.6.1" "0.6.2" "0.6.3" "0.6.4" "0.6.5" "0.6.6") }} 20 | 21 | ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-02-01" .Tag.Date }} 22 | 23 | {{ range .CommitGroups -}} 24 | ### {{ .Title }} 25 | {{ range .Commits -}} 26 | - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} 27 | {{ end }} 28 | {{ end -}} 29 | 30 | {{- if .RevertCommits -}} 31 | ### Reverts 32 | {{ range .RevertCommits -}} 33 | - {{ .Revert.Header }} 34 | {{ end }} 35 | {{ end -}} 36 | 37 | 38 | {{- if .NoteGroups -}} 39 | {{ range .NoteGroups -}} 40 | ### {{ .Title }} 41 | {{ range .Notes }} 42 | {{ .Body }} 43 | {{ end }} 44 | {{ end -}} 45 | {{ end -}} 46 | {{ end -}} 47 | 48 | {{ end -}} 49 | 50 | 51 | 52 | 53 | ## [0.6.6] - 2022-12-02 54 | 55 | ### Improved/Fixed 56 | 57 | - improve build process 58 | - improve periodic neighbor computation 59 | - improve documentation 60 | - improve CI/Tests 61 | - minor fixes 62 | 63 | 64 | 65 | ## [0.6.5] - 2022-03-02 66 | 67 | ### New Features 68 | 69 | - 2D/3D ``Shape`` object for easier lattice construction. 70 | - repeat/extend built lattices. 71 | 72 | ### Improved/Fixed 73 | 74 | - improve build process 75 | - improve periodic neighbor computation (still not stable) 76 | - add/improve tests 77 | - improve plotting 78 | - add more docstrings 79 | - fix multiple bugs 80 | 81 | 82 | {{- if .Versions }} 83 | 84 | [Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD 85 | {{ range .Versions -}} 86 | {{ if .Tag.Previous -}} 87 | [{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} 88 | {{ end -}} 89 | {{ end -}} 90 | {{ end -}} 91 | -------------------------------------------------------------------------------- /.chglog/config.yml: -------------------------------------------------------------------------------- 1 | # Git execution command. 2 | bin: git 3 | 4 | # Changelog style (github, gitlab, bitbucket, none) 5 | style: github 6 | 7 | # Path for the template file 8 | template: CHANGELOG.tpl.md 9 | 10 | # Metadata for CHANGELOG 11 | info: 12 | title: CHANGELOG 13 | repository_url: https://github.com/dylanljones/lattpy 14 | 15 | options: 16 | sort: "date" 17 | 18 | commits: 19 | filters: 20 | Type: 21 | - feat # New feature 22 | - fix # Bug fix 23 | - perf # performance improvements 24 | - refactor # code refactoring 25 | - docs # documentation updates 26 | # - build # update build config 27 | # - ci # continous integration updates 28 | # - test # Test changes 29 | # - update # Miscellaneous 30 | commit_groups: 31 | group_by: Type 32 | sort_by: Custom 33 | title_order: 34 | - feat 35 | - fix 36 | - perf 37 | - refactor 38 | - docs 39 | title_maps: 40 | feat: New Features 41 | fix: Improvements/Bug Fixes 42 | perf: Performance Improvements 43 | refactor: Code Refactoring 44 | docs: Documentation 45 | header: 46 | pattern: "^(\\w*)\\:\\s(.*)$" 47 | pattern_maps: 48 | - Type 49 | - Subject 50 | notes: 51 | keywords: 52 | - BREAKING CHANGE 53 | - DEPRECATED 54 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a bug report to help us improve lattpy 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | ````python 16 | ... 17 | ```` 18 | The resulting error is: 19 | > ... 20 | 21 | **Expected behavior** 22 | A clear and concise description of what you expected to happen. 23 | 24 | **Environment** 25 | - lattpy version: 26 | - OS and Python version: 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | # See also: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser 2 | 3 | # This is the default and blank issues are useful so let's keep 'em. 4 | blank_issues_enabled: true 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | schedule: 9 | - cron: "57 5 * * 6" 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze 14 | runs-on: ubuntu-latest 15 | permissions: 16 | actions: read 17 | contents: read 18 | security-events: write 19 | 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | language: [ python ] 24 | 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v3 28 | 29 | - name: Initialize CodeQL 30 | uses: github/codeql-action/init@v2 31 | with: 32 | languages: ${{ matrix.language }} 33 | queries: +security-and-quality 34 | 35 | - name: Autobuild 36 | uses: github/codeql-action/autobuild@v2 37 | 38 | - name: Perform CodeQL Analysis 39 | uses: github/codeql-action/analyze@v2 40 | with: 41 | category: "/language:${{ matrix.language }}" 42 | -------------------------------------------------------------------------------- /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Upload Python Package to PyPI 10 | 11 | # Controls when the action will run. 12 | on: 13 | # Triggers the workflow when a release is created 14 | release: 15 | types: [published] 16 | # Allows you to run this workflow manually from the Actions tab 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build-n-publish: 21 | name: Build and publish Python Package to PyPI 22 | runs-on: ubuntu-latest 23 | 24 | steps: 25 | - name: get latest release with tag 26 | id: latestrelease 27 | run: | 28 | echo "releasetag=$(curl -s https://api.github.com/repos/dylanljones/lattpy/releases/latest --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | jq '.tag_name' | sed 's/\"//g')" >> $GITHUB_ENV 29 | 30 | - name: confirm release tag 31 | run: | 32 | echo "${{ env.releasetag }}" 33 | 34 | - name: checkout 35 | uses: actions/checkout@v3 36 | with: 37 | ref: ${{ env.releasetag }} 38 | 39 | - name: Set up Python 40 | uses: actions/setup-python@v4 41 | with: 42 | python-version: "3.9" 43 | 44 | - name: Install dependencies 45 | run: | 46 | python -m pip install --upgrade pip 47 | pip install twine 48 | pip install .[build] 49 | 50 | - name: Build and publish distribution 📦 to Test PyPI 51 | env: 52 | TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} 53 | TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} 54 | run: | 55 | python setup.py sdist bdist_wheel 56 | twine upload --repository testpypi dist/* 57 | 58 | - name: Build and publish distribution 📦 to PyPI 59 | env: 60 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 61 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 62 | run: | 63 | python setup.py sdist bdist_wheel 64 | twine upload dist/* 65 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | branches: [master, dev] 6 | pull_request: 7 | types: [opened] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | 12 | code-change: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - id: skip_check 16 | uses: fkirc/skip-duplicate-actions@master 17 | with: 18 | paths_ignore: '[ 19 | "docs/**", 20 | ".github/**", 21 | ".social/**", 22 | "README.md", 23 | "CHANGELOG.md", 24 | "CONTRIBUTING.md", 25 | ".pre-commit-config.yaml", 26 | ".readthedocs.yaml", 27 | "pyproject.toml", 28 | "lgtm.yml" 29 | ]' 30 | outputs: 31 | should_skip: ${{ steps.skip_check.outputs.should_skip }} 32 | 33 | 34 | tests: 35 | needs: code-change 36 | if: ${{ needs.code-change.outputs.should_skip != 'true'}} 37 | strategy: 38 | matrix: 39 | os: [ubuntu-latest, windows-latest, macos-latest] 40 | python-version: ["3.7", "3.11"] # check oldest and latest supported version 41 | other-os: [false] 42 | 43 | runs-on: ${{ matrix.os }} 44 | continue-on-error: ${{ matrix.other-os }} # don't cancel due to OS specific failures 45 | env: 46 | OS: ${{ matrix.os }} 47 | PYTHON: ${{ matrix.python-version }} 48 | steps: 49 | - uses: actions/checkout@v3 50 | with: 51 | fetch-depth: 0 52 | - name: Set up Python ${{ matrix.python-version }} 53 | uses: actions/setup-python@v4 54 | with: 55 | python-version: ${{ matrix.python-version }} 56 | cache: "pip" # caching pip dependencies 57 | 58 | - name: Build and install 59 | run: | 60 | python -m pip install --upgrade pip 61 | pip install pytest pytest-cov codecov 62 | pip install .[test] 63 | 64 | - name: Get package version 65 | run: python setup.py --version 66 | 67 | - name: Run tests 68 | run: | 69 | pytest lattpy/ --cov=lattpy --cov-report=xml -v 70 | 71 | - name: Upload coverage to Codecov 72 | uses: codecov/codecov-action@v3 73 | with: 74 | env_vars: OS,PYTHON 75 | verbose: True 76 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # -- Project gitignore ----------------------------------------------------------------- 3 | 4 | dev_*.py 5 | .chglog/ 6 | project_*.py 7 | *.npz 8 | 9 | # setuptools_scm version file 10 | # Use this if the project uses pyproject.toml with setuptools_scm instead of setup.py 11 | */_version.py 12 | 13 | 14 | # -- Python gitignore ------------------------------------------------------------------ 15 | 16 | # Byte-compiled / optimized / DLL files 17 | __pycache__/ 18 | *.py[cod] 19 | *$py.class 20 | 21 | # C extensions 22 | *.so 23 | 24 | # Distribution / packaging 25 | .Python 26 | build/ 27 | develop-eggs/ 28 | dist/ 29 | downloads/ 30 | eggs/ 31 | .eggs/ 32 | lib/ 33 | lib64/ 34 | parts/ 35 | sdist/ 36 | var/ 37 | wheels/ 38 | pip-wheel-metadata/ 39 | share/python-wheels/ 40 | *.egg-info/ 41 | .installed.cfg 42 | *.egg 43 | MANIFEST 44 | 45 | # PyInstaller 46 | # Usually these files are written by a python script from a template 47 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 48 | *.manifest 49 | *.spec 50 | 51 | # Installer logs 52 | pip-log.txt 53 | pip-delete-this-directory.txt 54 | 55 | # Unit test / coverage reports 56 | htmlcov/ 57 | .tox/ 58 | .nox/ 59 | .coverage 60 | .coverage.* 61 | .cache 62 | nosetests.xml 63 | coverage.xml 64 | *.cover 65 | *.py,cover 66 | .hypothesis/ 67 | .pytest_cache/ 68 | cover/ 69 | 70 | # Translations 71 | *.mo 72 | *.pot 73 | 74 | # Django stuff: 75 | local_settings.py 76 | db.sqlite3 77 | db.sqlite3-journal 78 | 79 | # Flask stuff: 80 | instance/ 81 | .webassets-cache 82 | 83 | # Scrapy stuff: 84 | .scrapy 85 | 86 | # Sphinx documentation 87 | docs/_build/ 88 | 89 | # PyBuilder 90 | .pybuilder/ 91 | target/ 92 | 93 | # Jupyter Notebook 94 | .ipynb_checkpoints 95 | 96 | # IPython 97 | profile_default/ 98 | ipython_config.py 99 | 100 | # pyenv 101 | # For a library or package, you might want to ignore these files since the code is 102 | # intended to run in multiple environments; otherwise, check them in: 103 | # .python-version 104 | 105 | # pipenv 106 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 107 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 108 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 109 | # install all needed dependencies. 110 | # Pipfile.lock 111 | 112 | # poetry 113 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 114 | # This is especially recommended for binary packages to ensure reproducibility, and is more 115 | # commonly ignored for libraries. 116 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 117 | # poetry.lock 118 | 119 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 120 | __pypackages__/ 121 | 122 | # Celery stuff 123 | celerybeat-schedule 124 | celerybeat.pid 125 | 126 | # SageMath parsed files 127 | *.sage.py 128 | 129 | # Environments 130 | .env 131 | .venv 132 | env/ 133 | venv/ 134 | ENV/ 135 | env.bak/ 136 | venv.bak/ 137 | 138 | # Spyder project settings 139 | .spyderproject 140 | .spyproject 141 | 142 | # Rope project settings 143 | .ropeproject 144 | 145 | # mkdocs documentation 146 | /site 147 | 148 | # mypy 149 | .mypy_cache/ 150 | .dmypy.json 151 | dmypy.json 152 | 153 | # Pyre type checker 154 | .pyre/ 155 | 156 | # pytype static type analyzer 157 | .pytype/ 158 | 159 | # Cython debug symbols 160 | cython_debug/ 161 | 162 | 163 | # -- LaTeX gitignore ------------------------------------------------------------------- 164 | 165 | # LaTeX temporary files 166 | *.aux 167 | *.log 168 | *.toc 169 | 170 | # PDF output - usually a bad idea to keep this in Git 171 | *.pdf 172 | 173 | # Latexmk 174 | *.fdb_latexmk 175 | 176 | # SyncTeX 177 | *.synctex.gz 178 | 179 | # LaTeX Beamer 180 | *.snm 181 | *.vrb 182 | *.nav 183 | *.out 184 | 185 | # BibTeX 186 | *.bbl 187 | *.blg 188 | 189 | 190 | # -- Sublime gitignore ----------------------------------------------------------------- 191 | 192 | # Sublime Text Project Files (usually contain absolute paths) 193 | *.sublime-project 194 | *.sublime-workspace 195 | 196 | 197 | # -- JetBrains gitignore --------------------------------------------------------------- 198 | 199 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, 200 | # Android Studio, WebStorm and Rider 201 | # Source: https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 202 | 203 | # JetBrains project folder 204 | .idea/ 205 | 206 | # Uncomment for JetBrains specific template instead of ignoring all of .idea/ 207 | ## User-specific stuff 208 | #.idea/**/workspace.xml 209 | #.idea/**/tasks.xml 210 | #.idea/**/usage.statistics.xml 211 | #.idea/**/dictionaries 212 | #.idea/**/shelf 213 | # 214 | ## AWS User-specific 215 | #.idea/**/aws.xml 216 | # 217 | ## Generated files 218 | #.idea/**/contentModel.xml 219 | # 220 | ## Sensitive or high-churn files 221 | #.idea/**/dataSources/ 222 | #.idea/**/dataSources.ids 223 | #.idea/**/dataSources.local.xml 224 | #.idea/**/sqlDataSources.xml 225 | #.idea/**/dynamic.xml 226 | #.idea/**/uiDesigner.xml 227 | #.idea/**/dbnavigator.xml 228 | # 229 | ## Gradle 230 | #.idea/**/gradle.xml 231 | #.idea/**/libraries 232 | # 233 | ## Gradle and Maven with auto-import 234 | ## When using Gradle or Maven with auto-import, you should exclude module files, 235 | ## since they will be recreated, and may cause churn. Uncomment if using 236 | ## auto-import. 237 | ## .idea/artifacts 238 | ## .idea/compiler.xml 239 | ## .idea/jarRepositories.xml 240 | ## .idea/modules.xml 241 | ## .idea/*.iml 242 | ## .idea/modules 243 | ## *.iml 244 | ## *.ipr 245 | # 246 | ## CMake 247 | #cmake-build-*/ 248 | # 249 | ## Mongo Explorer plugin 250 | #.idea/**/mongoSettings.xml 251 | # 252 | ## File-based project format 253 | #*.iws 254 | # 255 | ## IntelliJ 256 | #out/ 257 | # 258 | ## mpeltonen/sbt-idea plugin 259 | #.idea_modules/ 260 | # 261 | ## JIRA plugin 262 | #atlassian-ide-plugin.xml 263 | # 264 | ## Cursive Clojure plugin 265 | #.idea/replstate.xml 266 | # 267 | ## SonarLint plugin 268 | #.idea/sonarlint/ 269 | # 270 | ## Crashlytics plugin (for Android Studio and IntelliJ) 271 | #com_crashlytics_export_strings.xml 272 | #crashlytics.properties 273 | #crashlytics-build.properties 274 | #fabric.properties 275 | # 276 | ## Editor-based Rest Client 277 | #.idea/httpRequests 278 | # 279 | ## Android studio 3.1+ serialized cache file 280 | #.idea/caches/build_file_checksums.ser 281 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # See https://pre-commit.com for more information 2 | # See https://pre-commit.com/hooks.html for more hooks 3 | 4 | repos: 5 | - repo: https://github.com/pre-commit/pre-commit-hooks 6 | rev: v4.4.0 7 | types: [py] 8 | hooks: 9 | - id: end-of-file-fixer 10 | - id: trailing-whitespace 11 | - id: mixed-line-ending 12 | 13 | - repo: https://github.com/psf/black 14 | rev: 23.1.0 15 | types: [ python ] 16 | hooks: 17 | - id: black 18 | args: [ --safe ] 19 | 20 | - repo: https://github.com/PyCQA/flake8 21 | rev: 6.0.0 22 | hooks: 23 | - id: flake8 24 | args: [--config, setup.cfg] 25 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | image: latest 5 | apt_packages: 6 | - graphviz 7 | 8 | python: 9 | version: 3.7 10 | install: 11 | - requirements: docs/source/requirements.txt 12 | - requirements: requirements.txt 13 | 14 | formats: 15 | - htmlzip 16 | - pdf 17 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # What's New 2 | 3 | 4 | ## [0.7.7] - 2022-02-11 5 | 6 | 7 | ### New Features 8 | - add additional spatial methods to lattice object 9 | - reuse coordinate system argument used for building lattice in other `Lattice`-methods 10 | 11 | ### Improvements/Bug Fixes 12 | - remove deprecated `set_num_neighbors` method 13 | - remove deprecated `fill` method from `DataMap` 14 | - remove deprecated `get_neighbor_pos` method from `LatticeData` 15 | 16 | 17 | 18 | ## [0.7.6] - 2022-12-06 19 | 20 | ### New Features 21 | - add method for getting limits of unit cells to `LatticeData` object 22 | - add conversion methods between cell index and super index for regular shapes to `LatticeBasis` 23 | - add `hypercubic` constructor to `LatticeBasis` object. 24 | - add `np.zeros` wrapper to `DataMap` 25 | 26 | ### Improvements/Bug Fixes 27 | - rename index methods of `Lattice` object to use superindex naming convention 28 | - cast `distidx` to full numpy array instead of list of arrays 29 | - replace deprecated `np.bool` type with the builtin `bool` 30 | - add endpoint argument to WignerSeitzCell meshgrid method 31 | - add endpoint argument to linspace of `WignerSeitzCell` 32 | 33 | ### BREAKING CHANGE 34 | 35 | `index_from_position` and `index_from_lattice_index` have been renamed to `superindex_from_pos` and `superindex_from_index`. 36 | 37 | 38 | 39 | ## [0.7.5] - 2022-25-05 40 | 41 | ### Improvements/Bug Fixes 42 | - fix error when setting periodic neighbors twice 43 | - set periodic axes only if size is big enough ([#67](https://github.com/dylanljones/lattpy/issues/67)) 44 | 45 | 46 | 47 | ## [0.7.4] - 2022-10-05 48 | 49 | ### New Features 50 | - add method `neighbor_pairs` for generating a list of neighbor indices 51 | 52 | ### Documentation 53 | - add example to `adjacency_matrix` 54 | - add docstring to `neighbor_pairs` 55 | 56 | 57 | 58 | ## [0.7.3] - 2022-06-05 59 | 60 | ### Improvements/Bug Fixes 61 | - `adjacency_matrix` is now vectorized and returns a `csr_matrix` 62 | - passing a False boolean as axis to `set_periodic` now removes the periodic boundaries 63 | 64 | 65 | 66 | ## [0.7.2] - 2022-04-05 67 | 68 | ### New Features 69 | - add prefabs for the hexagonal (triangular) and honeycomb lattice. 70 | - add methods for building sparse matrices to `DataMap` class 71 | 72 | ### Improvements/Bug Fixes 73 | - add argument for building in primitive basis to the `finite_hypercubic` method. 74 | 75 | 76 | 77 | ## [0.7.1] - 2022-29-03 78 | 79 | ### New Features 80 | - add argument for setting periodic boundary conditions to the `finite_hypercubic` method. 81 | - add method for computing minimum distances in a lattice with periodic boundary conditions 82 | - add `shape` keyword argument to Lattice constructor 83 | - add CSR/BSR sparse matrix format of indices and index-pointers to DataMap 84 | 85 | ### Code Refactoring 86 | - rename `distance` variables to `distances_` to prevent same name as method 87 | 88 | 89 | 90 | ## [0.7.0] - 2022-21-02 91 | 92 | ### New Features 93 | - Add method for computing the adjacency matrix of the lattice graph 94 | - Split the lattice structure into separate object ``LatticeStructure`` and use it as base class for ``Lattice`` 95 | - Split the lattice basis into separate object ``LatticeBasis`` and use it as base class for ``Lattice`` 96 | 97 | ### Code Refactoring 98 | - use black code formatter 99 | 100 | ### Documentation 101 | - add inheritance diagram to ``LatticeStructure`` and fix some docstrings 102 | - add inheritance diagram to ``Lattice`` 103 | - add example to ``LatticeBasis`` docstring 104 | - add attributes to docstring of ``LatticeBasis`` 105 | - improve docstring of ``Lattice`` class 106 | 107 | 108 | 109 | ## [0.6.7] - 2022-16-02 110 | 111 | ### New Features 112 | - add method for hiding the box and axis of a plot 113 | - Add ``finite_hypercubic`` lattice prefab 114 | - use git-chglog to auto-generate changelogs 115 | 116 | ### Improvements/Bug Fixes 117 | - add ``use_mplstyle`` to plotting module 118 | - change atom parameter order and fix resulting errors 119 | - use `box` for plot aspect ratio 120 | - improve lattice plotting and fix scaling/auto-limit issues 121 | - update change log template and include old entries 122 | 123 | ### Code Refactoring 124 | - rename unitcell module to atom 125 | 126 | ### Documentation 127 | - fix limits of plot in configuration tutorial 128 | - update index page of docs 129 | - fix docstrings of ``DataMap`` 130 | - add hamiltonian section to tutorial 131 | - add change log contributing to documentation 132 | 133 | 134 | ## [0.6.6] - 2022-12-02 135 | 136 | ### Improved/Fixed 137 | 138 | - improve build process 139 | - improve periodic neighbor computation 140 | - improve documentation 141 | - improve CI/Tests 142 | - minor fixes 143 | 144 | 145 | 146 | ## [0.6.5] - 2022-03-02 147 | 148 | ### New Features 149 | 150 | - 2D/3D ``Shape`` object for easier lattice construction. 151 | - repeat/extend built lattices. 152 | 153 | ### Improved/Fixed 154 | 155 | - improve build process 156 | - improve periodic neighbor computation (still not stable) 157 | - add/improve tests 158 | - improve plotting 159 | - add more docstrings 160 | - fix multiple bugs 161 | 162 | [Unreleased]: https://github.com/dylanljones/lattpy/compare/0.7.7...HEAD 163 | [0.7.7]: https://github.com/dylanljones/lattpy/compare/0.7.6...0.7.7 164 | [0.7.6]: https://github.com/dylanljones/lattpy/compare/0.7.5...0.7.6 165 | [0.7.5]: https://github.com/dylanljones/lattpy/compare/0.7.4...0.7.5 166 | [0.7.4]: https://github.com/dylanljones/lattpy/compare/0.7.3...0.7.4 167 | [0.7.3]: https://github.com/dylanljones/lattpy/compare/0.7.2...0.7.3 168 | [0.7.2]: https://github.com/dylanljones/lattpy/compare/0.7.1...0.7.2 169 | [0.7.1]: https://github.com/dylanljones/lattpy/compare/0.7.0...0.7.1 170 | [0.7.0]: https://github.com/dylanljones/lattpy/compare/0.6.7...0.7.0 171 | [0.6.7]: https://github.com/dylanljones/lattpy/compare/0.6.6...0.6.7 172 | [0.6.6]: https://github.com/dylanljones/lattpy/compare/0.6.5...0.6.6 173 | [0.6.5]: https://github.com/dylanljones/lattpy/compare/0.6.4...0.6.5 174 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | # YAML 1.2 2 | --- 3 | cff-version: "1.2.0" 4 | title: "lattpy" 5 | license: "MIT" 6 | date-released: 2022-05-25 7 | message: "If you use lattpy, please consider to cite the software using the metadata below." 8 | repository-code: "https://github.com/dylanljones/lattpy" 9 | authors: 10 | - family-names: Jones 11 | given-names: Dylan 12 | orcid: 'https://orcid.org/0000-0002-3410-4452' 13 | ... 14 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for contributing to `lattpy` :tada: 4 | 5 | ## Pre-commit Hooks 6 | 7 | We are using the [pre-commit framework](https://pre-commit.com/) to automatically run 8 | some checks and the [Black code formatter](https://github.com/psf/black) at commit time. 9 | This ensures that every commit fulfills the basic requirements to be mergeable and 10 | follows the coding style of the project. 11 | 12 | The pre-commit hooks can be installed via 13 | ````sh 14 | $ pre-commit install 15 | pre-commit installed at .git/hooks/pre-commit 16 | ```` 17 | 18 | ## Commit Message Format 19 | 20 | A format influenced by [Angular commit message]. 21 | 22 | ```text 23 | : 24 | 25 | 26 | 27 |