mdapy 2.0.0a2__tar.gz → 2.0.0b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/PKG-INFO +47 -81
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/README.md +45 -79
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/pyproject.toml +4 -1
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/visualization.cpp +3 -6
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render.cpp +3 -12
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render.h +0 -3
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render_metal.mm +2 -7
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render_vulkan.comp +2 -7
- mdapy-2.0.0b1/src/cpp/visualization/render_vulkan.spv +0 -0
- mdapy-2.0.0b1/src/cpp/visualization/render_vulkan_rt.spv +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/__init__.py +1 -1
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/_legend.py +68 -12
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/_render.py +43 -17
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/_scene.py +1 -23
- mdapy-2.0.0a2/src/cpp/visualization/render_vulkan.spv +0 -0
- mdapy-2.0.0a2/src/cpp/visualization/render_vulkan_rt.spv +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/.gitattributes +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/.gitignore +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/CMakeLists.txt +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/LICENSE +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dislocations.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dislocations.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/distribution.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/distribution.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_clusters.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_clusters.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_mapping.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_mapping.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_math.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_mesh.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_mesh.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_structure.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_structure.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_tracer.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/dxa_tracer.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/elastic_strain.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/elastic_strain.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/geometry.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/geometry.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/isosurface.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/isosurface.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/rings.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/rings.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/soap.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/soap.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/steinhardt.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/steinhardt.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/strain.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/strain.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/surface_mesh.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/surface_mesh.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/tessellation.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/tessellation.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/voronoi.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/analysis/voronoi.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/analysis.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/build.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/calculators.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/control.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/core.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/frames.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/identify.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/io.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/list_view.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/module.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/neighbor.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/bindings/testing.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/build/crystal.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/build/crystal.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/build/polycrystal.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/build/polycrystal.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/build/sqs.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/build/sqs.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/calculators/eam.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/calculators/eam.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/calculators/nep.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/calculators/nep.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/core/buffer.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/core/hardware.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/core/hardware.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/core/index.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/core/parallel.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/core/parallel.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/core/voronoi_cell.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/core/wrap.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/cna.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/grains.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/grains.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/planar_faults.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/planar_faults.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/ptm.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/ptm.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/ptm_data.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/ptm_data.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/ptm_tools.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/ptm_tools.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/structure.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/identify/structure.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/io/powers_of_five.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/io/text.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/io/text.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/neighbor/cell_list.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/neighbor/cell_list.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/neighbor/frame.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/neighbor/frames.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/neighbor/frames.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/neighbor/kd_tree.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/neighbor/kd_tree.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/neighbor/list_view.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render_d3d12.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render_d3d12.dxil +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render_d3d12.hlsl +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render_d3d12_rt.dxil +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render_gpu.h +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/cpp/visualization/render_vulkan.cpp +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_binning.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_bonds.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_correlation.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_dislocations.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_displacement.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_distribution.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_dynamics.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_elastic_strain.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_entropy.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_isosurface.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_polyhedra.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_rings.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_species.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_statistics.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_steinhardt.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_strain.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_surface_mesh.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_symmetry.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_temperature.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_voronoi.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/analysis/_wigner_seitz.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_alloy.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_anisotropic.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_crystal.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_defects.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_dislocation.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_dislocation_models.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_graphene.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_polycrystal.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/build/_sqs.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/calculators/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/calculators/_base.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/calculators/_eam.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/calculators/_lammps.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/calculators/_nep.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/calculators/_vasp.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/calculators/_zhou.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/calculators/testing.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/_atoms.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/_conditions.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/_frames.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/box.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/indices.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/mesh.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/result.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/system.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/threads.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/topology.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/core/versions.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/elements.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/errors.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/identify/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/identify/_grains.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/identify/_planar_faults.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/identify/_ptm.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/identify/_structure.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/interop/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/interop/_ase.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/interop/_ase_calculator.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/interop/_freud.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/interop/_ovito.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/interop/_pymatgen.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_cif.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_extxyz.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_files.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_lammps_data.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_lammps_dump.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_native.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_outcar.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_pdb.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_poscar.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_registry.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_text.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/io/_trajectory.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/lattice_dynamics/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/lattice_dynamics/_elastic.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/lattice_dynamics/_md_elastic.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/lattice_dynamics/_phonons.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/lattice_dynamics/_quasi_harmonic.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/lattice_dynamics/_sheets.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/lattice_dynamics/_thermal_elastic.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/lattice_dynamics/_thermal_phonons.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/mlip/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/mlip/_selection.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/mlip/_soap.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/mlip/_training.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/neighbor/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/neighbor/_expand.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/neighbor/_neighbor_list.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/neighbor/_overlapping.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/simulation/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/simulation/_defect_energies.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/simulation/_dynamics.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/simulation/_fault_free_energy.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/simulation/_free_energy.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/simulation/_melting.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/simulation/_minimize.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/simulation/_phase_diagram.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/transform/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/transform/_affine.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/transform/_bonds.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/transform/_combine.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/transform/_drift.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/transform/_frames.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/transform/_periodic.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/transform/_slice.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/units.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/__init__.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/_colormap_tables.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/_elements.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/_movie.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/_voxels.py +0 -0
- {mdapy-2.0.0a2 → mdapy-2.0.0b1}/src/mdapy/visualization/plot.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mdapy
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.0b1
|
|
4
4
|
Summary: Analysis and modelling of atomistic simulations
|
|
5
5
|
Author-Email: Yongchao Wu <934313174@qq.com>
|
|
6
6
|
License-Expression: MPL-2.0
|
|
7
7
|
License-File: LICENSE
|
|
8
|
-
Classifier: Development Status ::
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Intended Audience :: Science/Research
|
|
10
10
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
11
11
|
Classifier: Programming Language :: C++
|
|
@@ -60,6 +60,8 @@ Description-Content-Type: text/markdown
|
|
|
60
60
|
<p align="center">
|
|
61
61
|
<a href="https://github.com/mushroomfire/mdapy/actions/workflows/tests.yml"><img alt="Tests" src="https://github.com/mushroomfire/mdapy/actions/workflows/tests.yml/badge.svg?branch=master"></a>
|
|
62
62
|
<a href="https://codecov.io/gh/mushroomfire/mdapy"><img alt="Coverage" src="https://codecov.io/gh/mushroomfire/mdapy/branch/master/graph/badge.svg"></a>
|
|
63
|
+
<a href="https://pypi.org/project/mdapy/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/mdapy"></a>
|
|
64
|
+
<a href="https://pypi.org/project/mdapy/"><img alt="PyPI downloads" src="https://img.shields.io/pypi/dm/mdapy"></a>
|
|
63
65
|
<img alt="Python 3.11 or newer" src="https://img.shields.io/badge/python-3.11%2B-3776AB">
|
|
64
66
|
<img alt="Linux, macOS, Windows" src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-555555">
|
|
65
67
|
<a href="https://github.com/mushroomfire/mdapy/blob/master/LICENSE"><img alt="License: MPL-2.0" src="https://img.shields.io/badge/license-MPL--2.0-555555"></a>
|
|
@@ -122,89 +124,53 @@ If you like MDAPY, please give it a ⭐ [star](https://github.com/mushroomfire/m
|
|
|
122
124
|
|
|
123
125
|
## 🎨 Examples
|
|
124
126
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<table>
|
|
128
|
-
<tr><th width="58%">Build</th><th>Grains, 81,734 atoms</th></tr>
|
|
129
|
-
<tr><td>
|
|
130
|
-
|
|
131
|
-
```python
|
|
132
|
-
import mdapy as mp
|
|
133
|
-
from mdapy.build import build_crystal, build_polycrystal
|
|
134
|
-
from mdapy.visualization import render
|
|
135
|
-
|
|
136
|
-
copper = build_crystal("fcc", 3.615, elements="Cu")
|
|
137
|
-
grains = build_polycrystal(copper, mp.Box(100.0), 8, seed=1)
|
|
138
|
-
render(grains, "grains.png", color="grain")
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
</td><td><img alt="A polycrystal colored by grain" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/grains.png" width="100%"></td></tr>
|
|
142
|
-
<tr><th>Analyze</th><th>The atoms that are not fcc</th></tr>
|
|
143
|
-
<tr><td>
|
|
144
|
-
|
|
145
|
-
```python
|
|
146
|
-
from mdapy.identify import CommonNeighborAnalysis
|
|
147
|
-
|
|
148
|
-
structures = CommonNeighborAnalysis().compute(grains)
|
|
149
|
-
structures.counts() # {'other': 21162, 'fcc': 60691, ...}
|
|
150
|
-
boundaries = structures.structure != 1 # not fcc
|
|
151
|
-
render(grains, "boundaries.png", atoms=boundaries, color=structures)
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
</td><td><img alt="The grain boundaries of the polycrystal" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/boundaries.png" width="100%"></td></tr>
|
|
155
|
-
<tr><th>Simulate</th><th>Phonons of copper</th></tr>
|
|
156
|
-
<tr><td>
|
|
157
|
-
|
|
158
|
-
```python
|
|
159
|
-
from mdapy.calculators import EAM
|
|
160
|
-
from mdapy.lattice_dynamics import phonons, primitive_cell
|
|
161
|
-
from mdapy.simulation import minimize
|
|
162
|
-
from mdapy.visualization import plot
|
|
163
|
-
|
|
164
|
-
eam = EAM.zhou(["Cu"])
|
|
165
|
-
relaxed = minimize(copper, eam, cell="full", max_stress=1e-4)
|
|
166
|
-
cell = primitive_cell(relaxed.system)
|
|
167
|
-
bands = phonons(cell, eam).band_structure("fcc")
|
|
168
|
-
with plot.style():
|
|
169
|
-
fig, ax = plot.figure()
|
|
170
|
-
plot.band_structure(bands, ax=ax)
|
|
171
|
-
plot.save(fig, "phonons", formats=("png",))
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
</td><td><img alt="The phonon dispersion of copper" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/phonons.png" width="100%"></td></tr>
|
|
175
|
-
<tr><th>MLIP</th><th>The 20 frames most worth a DFT calculation</th></tr>
|
|
176
|
-
<tr><td>
|
|
177
|
-
|
|
178
|
-
```python
|
|
179
|
-
from mdapy import mlip
|
|
180
|
-
|
|
181
|
-
crystal = build_crystal("fcc", 3.615, elements="Cu", repeat=(3, 3, 3))
|
|
182
|
-
frames = mlip.perturb(crystal, 200, displacement=0.1, seed=1)
|
|
183
|
-
points = mlip.structure_descriptors(frames, mlip.SOAP(["Cu"]))
|
|
184
|
-
chosen = mlip.farthest_point_sampling(points, 20)
|
|
185
|
-
|
|
186
|
-
xy = mlip.principal_components(points).transform(points)
|
|
187
|
-
with plot.style():
|
|
188
|
-
fig, ax = plot.figure()
|
|
189
|
-
ax.scatter(*xy.T, s=4, color="0.7", label="all frames")
|
|
190
|
-
ax.scatter(*xy[chosen].T, s=12, label="chosen")
|
|
191
|
-
ax.set_xlabel("principal component 1")
|
|
192
|
-
ax.set_ylabel("principal component 2")
|
|
193
|
-
ax.legend()
|
|
194
|
-
plot.save(fig, "frames", formats=("png",))
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
</td><td><img alt="Frames on the map of their descriptors, with those chosen" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/frames.png" width="100%"></td></tr>
|
|
198
|
-
</table>
|
|
199
|
-
|
|
200
|
-
### Make a movie
|
|
127
|
+
Click a picture for its example, with the whole code.
|
|
201
128
|
|
|
202
129
|
<p align="center">
|
|
203
|
-
<a href="https://mushroomfire.github.io/mdapy/examples/movie/"><img alt="A movie that flies through a copper polycrystal" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/examples/images/movie.webp" width="480"></a>
|
|
130
|
+
<a href="https://mushroomfire.github.io/mdapy/examples/movie/"><img alt="A movie that flies through a copper polycrystal" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/examples/images/movie.webp" width="480"></a><br>
|
|
131
|
+
<a href="https://mushroomfire.github.io/mdapy/examples/movie/"><b>Fly through a crystal</b></a>
|
|
204
132
|
</p>
|
|
205
133
|
|
|
206
|
-
|
|
207
|
-
|
|
134
|
+
<table>
|
|
135
|
+
<tr>
|
|
136
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/build/polycrystals/"><img alt="Polycrystals" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/polycrystal.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/build/polycrystals/"><b>Polycrystals</b></a></td>
|
|
137
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/gradient-polycrystals/"><img alt="Gradient grains" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/gradient.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/gradient-polycrystals/"><b>Gradient grains</b></a></td>
|
|
138
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/graphene-polycrystal/"><img alt="Graphene grains" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/graphene.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/graphene-polycrystal/"><b>Graphene grains</b></a></td>
|
|
139
|
+
</tr>
|
|
140
|
+
<tr>
|
|
141
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/molecular-polycrystal/"><img alt="Ice polycrystal" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/ice.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/molecular-polycrystal/"><b>Ice polycrystal</b></a></td>
|
|
142
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/build/sqs/"><img alt="Quasirandom alloys" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/sqs.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/build/sqs/"><b>Quasirandom alloys</b></a></td>
|
|
143
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/dislocations/"><img alt="Dislocations" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/dislocations.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/dislocations/"><b>Dislocations</b></a></td>
|
|
144
|
+
</tr>
|
|
145
|
+
<tr>
|
|
146
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/ptm/"><img alt="Structure types" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/icosahedron.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/ptm/"><b>Structure types</b></a></td>
|
|
147
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/voronoi/"><img alt="Voronoi cells" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/voronoi.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/voronoi/"><b>Voronoi cells</b></a></td>
|
|
148
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/space-group/"><img alt="Point groups" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/point-group.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/space-group/"><b>Point groups</b></a></td>
|
|
149
|
+
</tr>
|
|
150
|
+
<tr>
|
|
151
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/atomic-strain/"><img alt="Atomic strain" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/strain.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/atomic-strain/"><b>Atomic strain</b></a></td>
|
|
152
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/rings/"><img alt="Rings" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/rings.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/rings/"><b>Rings</b></a></td>
|
|
153
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/clusters/"><img alt="Clusters" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/clusters.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/clusters/"><b>Clusters</b></a></td>
|
|
154
|
+
</tr>
|
|
155
|
+
<tr>
|
|
156
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/chill-plus/"><img alt="Ice and water" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/ice-structure.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/chill-plus/"><b>Ice and water</b></a></td>
|
|
157
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/trajectory-lines/"><img alt="Atom paths" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/trajectories.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/trajectory-lines/"><b>Atom paths</b></a></td>
|
|
158
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/visualization/polyhedra/"><img alt="Polyhedra" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/polyhedra.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/visualization/polyhedra/"><b>Polyhedra</b></a></td>
|
|
159
|
+
</tr>
|
|
160
|
+
<tr>
|
|
161
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/gamma-surface/"><img alt="Gamma surfaces" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/gamma-surface.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/gamma-surface/"><b>Gamma surfaces</b></a></td>
|
|
162
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/crconi/"><img alt="NEP against DFT" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/crconi.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/crconi/"><b>NEP against DFT</b></a></td>
|
|
163
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/simulation/phase-diagram/"><img alt="Phase diagrams" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/phase-diagram.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/simulation/phase-diagram/"><b>Phase diagrams</b></a></td>
|
|
164
|
+
</tr>
|
|
165
|
+
<tr>
|
|
166
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/surface-mesh/"><img alt="Surface meshes" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/surface-mesh.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/surface-mesh/"><b>Surface meshes</b></a></td>
|
|
167
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/mlip/uncertainty/"><img alt="Model uncertainty" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/uncertainty.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/mlip/uncertainty/"><b>Model uncertainty</b></a></td>
|
|
168
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/high-throughput/"><img alt="High throughput" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/high-throughput.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/high-throughput/"><b>High throughput</b></a></td>
|
|
169
|
+
</tr>
|
|
170
|
+
</table>
|
|
171
|
+
|
|
172
|
+
More in the [documentation](https://mushroomfire.github.io/mdapy/), from the
|
|
173
|
+
[quick tour](https://mushroomfire.github.io/mdapy/getting-started/quick-tour/) on.
|
|
208
174
|
|
|
209
175
|
## 📦 Install
|
|
210
176
|
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
<p align="center">
|
|
13
13
|
<a href="https://github.com/mushroomfire/mdapy/actions/workflows/tests.yml"><img alt="Tests" src="https://github.com/mushroomfire/mdapy/actions/workflows/tests.yml/badge.svg?branch=master"></a>
|
|
14
14
|
<a href="https://codecov.io/gh/mushroomfire/mdapy"><img alt="Coverage" src="https://codecov.io/gh/mushroomfire/mdapy/branch/master/graph/badge.svg"></a>
|
|
15
|
+
<a href="https://pypi.org/project/mdapy/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/mdapy"></a>
|
|
16
|
+
<a href="https://pypi.org/project/mdapy/"><img alt="PyPI downloads" src="https://img.shields.io/pypi/dm/mdapy"></a>
|
|
15
17
|
<img alt="Python 3.11 or newer" src="https://img.shields.io/badge/python-3.11%2B-3776AB">
|
|
16
18
|
<img alt="Linux, macOS, Windows" src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-555555">
|
|
17
19
|
<a href="https://github.com/mushroomfire/mdapy/blob/master/LICENSE"><img alt="License: MPL-2.0" src="https://img.shields.io/badge/license-MPL--2.0-555555"></a>
|
|
@@ -74,89 +76,53 @@ If you like MDAPY, please give it a ⭐ [star](https://github.com/mushroomfire/m
|
|
|
74
76
|
|
|
75
77
|
## 🎨 Examples
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<table>
|
|
80
|
-
<tr><th width="58%">Build</th><th>Grains, 81,734 atoms</th></tr>
|
|
81
|
-
<tr><td>
|
|
82
|
-
|
|
83
|
-
```python
|
|
84
|
-
import mdapy as mp
|
|
85
|
-
from mdapy.build import build_crystal, build_polycrystal
|
|
86
|
-
from mdapy.visualization import render
|
|
87
|
-
|
|
88
|
-
copper = build_crystal("fcc", 3.615, elements="Cu")
|
|
89
|
-
grains = build_polycrystal(copper, mp.Box(100.0), 8, seed=1)
|
|
90
|
-
render(grains, "grains.png", color="grain")
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
</td><td><img alt="A polycrystal colored by grain" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/grains.png" width="100%"></td></tr>
|
|
94
|
-
<tr><th>Analyze</th><th>The atoms that are not fcc</th></tr>
|
|
95
|
-
<tr><td>
|
|
96
|
-
|
|
97
|
-
```python
|
|
98
|
-
from mdapy.identify import CommonNeighborAnalysis
|
|
99
|
-
|
|
100
|
-
structures = CommonNeighborAnalysis().compute(grains)
|
|
101
|
-
structures.counts() # {'other': 21162, 'fcc': 60691, ...}
|
|
102
|
-
boundaries = structures.structure != 1 # not fcc
|
|
103
|
-
render(grains, "boundaries.png", atoms=boundaries, color=structures)
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
</td><td><img alt="The grain boundaries of the polycrystal" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/boundaries.png" width="100%"></td></tr>
|
|
107
|
-
<tr><th>Simulate</th><th>Phonons of copper</th></tr>
|
|
108
|
-
<tr><td>
|
|
109
|
-
|
|
110
|
-
```python
|
|
111
|
-
from mdapy.calculators import EAM
|
|
112
|
-
from mdapy.lattice_dynamics import phonons, primitive_cell
|
|
113
|
-
from mdapy.simulation import minimize
|
|
114
|
-
from mdapy.visualization import plot
|
|
115
|
-
|
|
116
|
-
eam = EAM.zhou(["Cu"])
|
|
117
|
-
relaxed = minimize(copper, eam, cell="full", max_stress=1e-4)
|
|
118
|
-
cell = primitive_cell(relaxed.system)
|
|
119
|
-
bands = phonons(cell, eam).band_structure("fcc")
|
|
120
|
-
with plot.style():
|
|
121
|
-
fig, ax = plot.figure()
|
|
122
|
-
plot.band_structure(bands, ax=ax)
|
|
123
|
-
plot.save(fig, "phonons", formats=("png",))
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
</td><td><img alt="The phonon dispersion of copper" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/phonons.png" width="100%"></td></tr>
|
|
127
|
-
<tr><th>MLIP</th><th>The 20 frames most worth a DFT calculation</th></tr>
|
|
128
|
-
<tr><td>
|
|
129
|
-
|
|
130
|
-
```python
|
|
131
|
-
from mdapy import mlip
|
|
132
|
-
|
|
133
|
-
crystal = build_crystal("fcc", 3.615, elements="Cu", repeat=(3, 3, 3))
|
|
134
|
-
frames = mlip.perturb(crystal, 200, displacement=0.1, seed=1)
|
|
135
|
-
points = mlip.structure_descriptors(frames, mlip.SOAP(["Cu"]))
|
|
136
|
-
chosen = mlip.farthest_point_sampling(points, 20)
|
|
137
|
-
|
|
138
|
-
xy = mlip.principal_components(points).transform(points)
|
|
139
|
-
with plot.style():
|
|
140
|
-
fig, ax = plot.figure()
|
|
141
|
-
ax.scatter(*xy.T, s=4, color="0.7", label="all frames")
|
|
142
|
-
ax.scatter(*xy[chosen].T, s=12, label="chosen")
|
|
143
|
-
ax.set_xlabel("principal component 1")
|
|
144
|
-
ax.set_ylabel("principal component 2")
|
|
145
|
-
ax.legend()
|
|
146
|
-
plot.save(fig, "frames", formats=("png",))
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
</td><td><img alt="Frames on the map of their descriptors, with those chosen" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/frames.png" width="100%"></td></tr>
|
|
150
|
-
</table>
|
|
151
|
-
|
|
152
|
-
### Make a movie
|
|
79
|
+
Click a picture for its example, with the whole code.
|
|
153
80
|
|
|
154
81
|
<p align="center">
|
|
155
|
-
<a href="https://mushroomfire.github.io/mdapy/examples/movie/"><img alt="A movie that flies through a copper polycrystal" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/examples/images/movie.webp" width="480"></a>
|
|
82
|
+
<a href="https://mushroomfire.github.io/mdapy/examples/movie/"><img alt="A movie that flies through a copper polycrystal" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/examples/images/movie.webp" width="480"></a><br>
|
|
83
|
+
<a href="https://mushroomfire.github.io/mdapy/examples/movie/"><b>Fly through a crystal</b></a>
|
|
156
84
|
</p>
|
|
157
85
|
|
|
158
|
-
|
|
159
|
-
|
|
86
|
+
<table>
|
|
87
|
+
<tr>
|
|
88
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/build/polycrystals/"><img alt="Polycrystals" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/polycrystal.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/build/polycrystals/"><b>Polycrystals</b></a></td>
|
|
89
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/gradient-polycrystals/"><img alt="Gradient grains" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/gradient.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/gradient-polycrystals/"><b>Gradient grains</b></a></td>
|
|
90
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/graphene-polycrystal/"><img alt="Graphene grains" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/graphene.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/graphene-polycrystal/"><b>Graphene grains</b></a></td>
|
|
91
|
+
</tr>
|
|
92
|
+
<tr>
|
|
93
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/molecular-polycrystal/"><img alt="Ice polycrystal" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/ice.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/molecular-polycrystal/"><b>Ice polycrystal</b></a></td>
|
|
94
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/build/sqs/"><img alt="Quasirandom alloys" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/sqs.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/build/sqs/"><b>Quasirandom alloys</b></a></td>
|
|
95
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/dislocations/"><img alt="Dislocations" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/dislocations.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/dislocations/"><b>Dislocations</b></a></td>
|
|
96
|
+
</tr>
|
|
97
|
+
<tr>
|
|
98
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/ptm/"><img alt="Structure types" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/icosahedron.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/ptm/"><b>Structure types</b></a></td>
|
|
99
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/voronoi/"><img alt="Voronoi cells" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/voronoi.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/voronoi/"><b>Voronoi cells</b></a></td>
|
|
100
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/space-group/"><img alt="Point groups" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/point-group.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/space-group/"><b>Point groups</b></a></td>
|
|
101
|
+
</tr>
|
|
102
|
+
<tr>
|
|
103
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/atomic-strain/"><img alt="Atomic strain" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/strain.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/atomic-strain/"><b>Atomic strain</b></a></td>
|
|
104
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/rings/"><img alt="Rings" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/rings.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/rings/"><b>Rings</b></a></td>
|
|
105
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/clusters/"><img alt="Clusters" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/clusters.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/clusters/"><b>Clusters</b></a></td>
|
|
106
|
+
</tr>
|
|
107
|
+
<tr>
|
|
108
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/chill-plus/"><img alt="Ice and water" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/ice-structure.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/chill-plus/"><b>Ice and water</b></a></td>
|
|
109
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/trajectory-lines/"><img alt="Atom paths" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/trajectories.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/trajectory-lines/"><b>Atom paths</b></a></td>
|
|
110
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/visualization/polyhedra/"><img alt="Polyhedra" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/polyhedra.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/visualization/polyhedra/"><b>Polyhedra</b></a></td>
|
|
111
|
+
</tr>
|
|
112
|
+
<tr>
|
|
113
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/gamma-surface/"><img alt="Gamma surfaces" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/gamma-surface.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/gamma-surface/"><b>Gamma surfaces</b></a></td>
|
|
114
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/crconi/"><img alt="NEP against DFT" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/crconi.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/crconi/"><b>NEP against DFT</b></a></td>
|
|
115
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/simulation/phase-diagram/"><img alt="Phase diagrams" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/phase-diagram.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/simulation/phase-diagram/"><b>Phase diagrams</b></a></td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/surface-mesh/"><img alt="Surface meshes" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/surface-mesh.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/analysis/surface-mesh/"><b>Surface meshes</b></a></td>
|
|
119
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/user-guide/mlip/uncertainty/"><img alt="Model uncertainty" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/uncertainty.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/user-guide/mlip/uncertainty/"><b>Model uncertainty</b></a></td>
|
|
120
|
+
<td align="center" width="33%"><a href="https://mushroomfire.github.io/mdapy/examples/high-throughput/"><img alt="High throughput" src="https://raw.githubusercontent.com/mushroomfire/mdapy/master/docs/assets/readme/high-throughput.png" width="100%"></a><br><a href="https://mushroomfire.github.io/mdapy/examples/high-throughput/"><b>High throughput</b></a></td>
|
|
121
|
+
</tr>
|
|
122
|
+
</table>
|
|
123
|
+
|
|
124
|
+
More in the [documentation](https://mushroomfire.github.io/mdapy/), from the
|
|
125
|
+
[quick tour](https://mushroomfire.github.io/mdapy/getting-started/quick-tour/) on.
|
|
160
126
|
|
|
161
127
|
## 📦 Install
|
|
162
128
|
|
|
@@ -13,7 +13,7 @@ license-files = ["LICENSE"]
|
|
|
13
13
|
authors = [{ name = "Yongchao Wu", email = "934313174@qq.com" }]
|
|
14
14
|
dependencies = ["numpy>=2.3.1", "polars>=2"]
|
|
15
15
|
classifiers = [
|
|
16
|
-
"Development Status ::
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
17
|
"Intended Audience :: Science/Research",
|
|
18
18
|
"Topic :: Scientific/Engineering :: Physics",
|
|
19
19
|
"Programming Language :: C++",
|
|
@@ -84,6 +84,9 @@ filterwarnings = [
|
|
|
84
84
|
"ignore:Setting the shape on a NumPy array:DeprecationWarning:ase",
|
|
85
85
|
# pymatgen asks spglib for the old error handling, which spglib deprecates
|
|
86
86
|
"ignore:Set OLD_ERROR_HANDLING to false:DeprecationWarning:spglib",
|
|
87
|
+
# SciPy's norm, which ASE's optimizers call, uses numpy.isfortran, which NumPy 2.6
|
|
88
|
+
# deprecates
|
|
89
|
+
"ignore:numpy.isfortran is deprecated:DeprecationWarning:scipy",
|
|
87
90
|
]
|
|
88
91
|
|
|
89
92
|
[tool.coverage.run]
|
|
@@ -69,8 +69,8 @@ nb::object render(Rows<3> sphere_center, Floats sphere_radius, Rows<3> sphere_co
|
|
|
69
69
|
Rows<6> cylinder_end, Floats cylinder_radius, Rows<3> cylinder_color,
|
|
70
70
|
Ids cylinder_id, Rows<9> triangle_vertex, Rows<3> triangle_color,
|
|
71
71
|
Floats triangle_alpha, Ids triangle_id, Three center, Three forward, Three up,
|
|
72
|
-
float half_width, float half_height, bool perspective,
|
|
73
|
-
|
|
72
|
+
float half_width, float half_height, bool perspective, int width,
|
|
73
|
+
int height, float ambient, float diffuse,
|
|
74
74
|
float specular, float shininess, float metalness, Three key, Three highlight, Three fill,
|
|
75
75
|
float fill_intensity, int ao_samples, float ao_distance, float ao_strength,
|
|
76
76
|
bool shadows, float shadow_strength, bool flat, int toon_levels,
|
|
@@ -88,8 +88,6 @@ nb::object render(Rows<3> sphere_center, Floats sphere_radius, Rows<3> sphere_co
|
|
|
88
88
|
camera.half_width = half_width;
|
|
89
89
|
camera.half_height = half_height;
|
|
90
90
|
camera.perspective = perspective;
|
|
91
|
-
camera.aperture = aperture;
|
|
92
|
-
camera.focal_distance = focal_distance;
|
|
93
91
|
visualization::Style style;
|
|
94
92
|
style.ambient = ambient;
|
|
95
93
|
style.diffuse = diffuse;
|
|
@@ -167,8 +165,7 @@ void bind_visualization(nb::module_& m) {
|
|
|
167
165
|
nb::arg("triangle_vertex"), nb::arg("triangle_color"), nb::arg("triangle_alpha"),
|
|
168
166
|
nb::arg("triangle_id"), nb::arg("center"), nb::arg("forward"), nb::arg("up"),
|
|
169
167
|
nb::arg("half_width"), nb::arg("half_height"), nb::arg("perspective"),
|
|
170
|
-
nb::arg("
|
|
171
|
-
nb::arg("height"), nb::arg("ambient"), nb::arg("diffuse"),
|
|
168
|
+
nb::arg("width"), nb::arg("height"), nb::arg("ambient"), nb::arg("diffuse"),
|
|
172
169
|
nb::arg("specular"), nb::arg("shininess"), nb::arg("metalness"), nb::arg("key"),
|
|
173
170
|
nb::arg("highlight"), nb::arg("fill"),
|
|
174
171
|
nb::arg("fill_intensity"), nb::arg("ao_samples"), nb::arg("ao_distance"),
|
|
@@ -876,7 +876,6 @@ std::vector<std::uint8_t> render(const Scene& scene, const Camera& camera, const
|
|
|
876
876
|
};
|
|
877
877
|
const bool global = style.bounces > 0;
|
|
878
878
|
const int samples = style.samples;
|
|
879
|
-
const bool lens = camera.perspective && camera.aperture > 0;
|
|
880
879
|
|
|
881
880
|
const std::int64_t grain = std::max<std::int64_t>(1, 64 / s);
|
|
882
881
|
if (style.gpu) {
|
|
@@ -887,8 +886,9 @@ std::vector<std::uint8_t> render(const Scene& scene, const Camera& camera, const
|
|
|
887
886
|
copy3(params.up, up);
|
|
888
887
|
params.half_width = camera.half_width;
|
|
889
888
|
params.half_height = camera.half_height;
|
|
890
|
-
|
|
891
|
-
params.
|
|
889
|
+
// the shader of Direct3D 12 still reads a lens, for a depth of field that is gone: none
|
|
890
|
+
params.aperture = 0.0f;
|
|
891
|
+
params.focal_distance = 1.0f;
|
|
892
892
|
params.start = start;
|
|
893
893
|
params.nearest = nearest;
|
|
894
894
|
params.farthest = farthest;
|
|
@@ -959,15 +959,6 @@ std::vector<std::uint8_t> render(const Scene& scene, const Camera& camera, const
|
|
|
959
959
|
const V d = unit(forward + right * (px * camera.half_width) +
|
|
960
960
|
up * (py * camera.half_height));
|
|
961
961
|
ray = make_ray(center, d);
|
|
962
|
-
if (lens) {
|
|
963
|
-
// from a point of the lens to where the ray
|
|
964
|
-
// through its middle meets the sharp plane
|
|
965
|
-
const V sharp = center + d * (camera.focal_distance / dot(d, forward));
|
|
966
|
-
const float u = random.next(), phi = 6.2831853f * random.next();
|
|
967
|
-
const float r = camera.aperture * std::sqrt(u);
|
|
968
|
-
const V from = center + right * (r * std::cos(phi)) + up * (r * std::sin(phi));
|
|
969
|
-
ray = make_ray(from, unit(sharp - from));
|
|
970
|
-
}
|
|
971
962
|
} else {
|
|
972
963
|
ray = make_ray(center + right * (px * camera.half_width) +
|
|
973
964
|
up * (py * camera.half_height) + forward * start,
|
|
@@ -38,13 +38,10 @@ struct Scene {
|
|
|
38
38
|
// An orthographic camera looks along forward at a window of half_width by
|
|
39
39
|
// half_height around center; a perspective camera stands at center and
|
|
40
40
|
// half_width and half_height are the tangents of half its angles of view.
|
|
41
|
-
// A perspective camera with an aperture > 0 sees through a lens of that
|
|
42
|
-
// radius, sharp at focal_distance along forward only (depth of field).
|
|
43
41
|
struct Camera {
|
|
44
42
|
std::array<float, 3> center{}, forward{0, 0, -1}, up{0, 1, 0};
|
|
45
43
|
float half_width = 1, half_height = 1;
|
|
46
44
|
bool perspective = false;
|
|
47
|
-
float aperture = 0, focal_distance = 1;
|
|
48
45
|
};
|
|
49
46
|
|
|
50
47
|
struct Style {
|
|
@@ -43,6 +43,8 @@ struct Node {
|
|
|
43
43
|
|
|
44
44
|
struct Params {
|
|
45
45
|
float center[3], forward[3], right[3], up[3];
|
|
46
|
+
// aperture and focal_distance, a lens no longer read, keep the layout that
|
|
47
|
+
// Direct3D 12 shares until its shader is compiled again
|
|
46
48
|
float half_width, half_height, aperture, focal_distance;
|
|
47
49
|
float start, nearest, farthest, epsilon;
|
|
48
50
|
float key[3], highlight[3], fill[3], key_tangent[3], key_bitangent[3];
|
|
@@ -622,13 +624,6 @@ kernel void trace_subpixels(device const float* sphere_center [[buffer(0)]],
|
|
|
622
624
|
if (P.perspective) {
|
|
623
625
|
const float3 d = unit(forward + right * (px * P.half_width) + up * (py * P.half_height));
|
|
624
626
|
ray = make_ray(center, d);
|
|
625
|
-
if (P.aperture > 0) {
|
|
626
|
-
const float3 sharp = center + d * (P.focal_distance / dot(d, forward));
|
|
627
|
-
const float u = next(random), phi = 6.2831853f * next(random);
|
|
628
|
-
const float r = P.aperture * sqrt(u);
|
|
629
|
-
const float3 from = center + right * (r * cos(phi)) + up * (r * sin(phi));
|
|
630
|
-
ray = make_ray(from, unit(sharp - from));
|
|
631
|
-
}
|
|
632
627
|
} else {
|
|
633
628
|
ray = make_ray(center + right * (px * P.half_width) + up * (py * P.half_height) + forward * P.start, forward);
|
|
634
629
|
}
|
|
@@ -22,6 +22,8 @@ layout(local_size_x = 8, local_size_y = 8) in;
|
|
|
22
22
|
|
|
23
23
|
struct Params {
|
|
24
24
|
float center[3], forward[3], right[3], up[3];
|
|
25
|
+
// aperture and focal_distance, a lens no longer read, keep the layout that
|
|
26
|
+
// Direct3D 12 shares until its shader is compiled again
|
|
25
27
|
float half_width, half_height, aperture, focal_distance;
|
|
26
28
|
float start, nearest, farthest, epsilon;
|
|
27
29
|
float key[3], highlight[3], fill[3], key_tangent[3], key_bitangent[3];
|
|
@@ -546,13 +548,6 @@ void main() {
|
|
|
546
548
|
if (P.perspective != 0) {
|
|
547
549
|
const vec3 d = unit(forward + right * (px * P.half_width) + up * (py * P.half_height));
|
|
548
550
|
ray = make_ray(center, d);
|
|
549
|
-
if (P.aperture > 0.0) {
|
|
550
|
-
const vec3 sharp = center + d * (P.focal_distance / dot(d, forward));
|
|
551
|
-
const float u = next(random), phi = 6.2831853 * next(random);
|
|
552
|
-
const float r = P.aperture * sqrt(u);
|
|
553
|
-
const vec3 from = center + right * (r * cos(phi)) + up * (r * sin(phi));
|
|
554
|
-
ray = make_ray(from, unit(sharp - from));
|
|
555
|
-
}
|
|
556
551
|
} else {
|
|
557
552
|
ray = make_ray(center + right * (px * P.half_width) + up * (py * P.half_height) + forward * P.start, forward);
|
|
558
553
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
|
|
4
4
|
# obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
|
|
6
|
-
"""A legend
|
|
6
|
+
"""A legend beside a picture: what the colors of its atoms mean."""
|
|
7
7
|
|
|
8
8
|
from collections.abc import Sequence
|
|
9
9
|
from typing import Any
|
|
@@ -16,22 +16,32 @@ from mdapy.visualization._scene import _color, colormap
|
|
|
16
16
|
_FONT = 0.03
|
|
17
17
|
_SMALLEST_FONT = 10.0
|
|
18
18
|
_BAR_LENGTH = 7.0
|
|
19
|
+
_FONTS = {
|
|
20
|
+
"font.family": "sans-serif",
|
|
21
|
+
"font.sans-serif": ["Arial", "Helvetica", "DejaVu Sans"],
|
|
22
|
+
}
|
|
19
23
|
|
|
20
24
|
|
|
21
|
-
def
|
|
22
|
-
"""(H, W, 4) floats from 0 to 1 of what draw puts on empty axes in pixels."""
|
|
25
|
+
def _matplotlib() -> tuple[Any, Any, Any]:
|
|
23
26
|
try:
|
|
24
27
|
from matplotlib import rc_context
|
|
25
28
|
from matplotlib.backends.backend_agg import FigureCanvasAgg
|
|
26
29
|
from matplotlib.figure import Figure
|
|
27
30
|
except ImportError:
|
|
28
31
|
raise ImportError("a legend needs matplotlib: pip install matplotlib") from None
|
|
32
|
+
return rc_context, FigureCanvasAgg, Figure
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _font(height: int) -> float:
|
|
36
|
+
"""The size of the text of the legend of a picture, in pixels."""
|
|
37
|
+
return max(_SMALLEST_FONT, _FONT * height)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _drawn(figure_size: tuple[int, int], draw: Any) -> np.ndarray:
|
|
41
|
+
"""(H, W, 4) floats from 0 to 1 of what draw puts on empty axes in pixels."""
|
|
42
|
+
rc_context, FigureCanvasAgg, Figure = _matplotlib()
|
|
29
43
|
height, width = figure_size
|
|
30
|
-
|
|
31
|
-
"font.family": "sans-serif",
|
|
32
|
-
"font.sans-serif": ["Arial", "Helvetica", "DejaVu Sans"],
|
|
33
|
-
}
|
|
34
|
-
with rc_context(fonts):
|
|
44
|
+
with rc_context(_FONTS):
|
|
35
45
|
figure = Figure(figsize=(width / 100, height / 100), dpi=100)
|
|
36
46
|
canvas = FigureCanvasAgg(figure)
|
|
37
47
|
figure.patch.set_alpha(0.0)
|
|
@@ -44,6 +54,44 @@ def _drawn(figure_size: tuple[int, int], draw: Any) -> np.ndarray:
|
|
|
44
54
|
return np.asarray(canvas.buffer_rgba(), dtype=float) / 255.0
|
|
45
55
|
|
|
46
56
|
|
|
57
|
+
def _text_width(texts: Sequence[str], points: float) -> float:
|
|
58
|
+
"""The width in pixels of the widest of the texts in this size."""
|
|
59
|
+
rc_context, FigureCanvasAgg, Figure = _matplotlib()
|
|
60
|
+
with rc_context(_FONTS):
|
|
61
|
+
figure = Figure(figsize=(1.0, 1.0), dpi=100)
|
|
62
|
+
renderer = FigureCanvasAgg(figure).get_renderer()
|
|
63
|
+
return max(
|
|
64
|
+
(
|
|
65
|
+
figure.text(0.0, 0.0, text, fontsize=points)
|
|
66
|
+
.get_window_extent(renderer)
|
|
67
|
+
.width
|
|
68
|
+
for text in texts
|
|
69
|
+
),
|
|
70
|
+
default=0.0,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _legend_width(
|
|
75
|
+
height: int,
|
|
76
|
+
*,
|
|
77
|
+
names: Sequence[str] = (),
|
|
78
|
+
colors: Any = (),
|
|
79
|
+
title: str = "",
|
|
80
|
+
bar: tuple[float, float, str] | None = None,
|
|
81
|
+
) -> int:
|
|
82
|
+
"""The width in pixels of the column of a legend beside a picture of
|
|
83
|
+
this height, its margins included."""
|
|
84
|
+
font = _font(height)
|
|
85
|
+
points = font * 0.72 # at 100 dots per inch
|
|
86
|
+
widths = [_text_width([title], points)] if title else []
|
|
87
|
+
if names:
|
|
88
|
+
widths.append(1.1 * font + _text_width(names, points))
|
|
89
|
+
if bar is not None:
|
|
90
|
+
low, high, _ = bar
|
|
91
|
+
widths.append(1.3 * font + _text_width([f"{low:.3g}", f"{high:.3g}"], points))
|
|
92
|
+
return int(np.ceil(2.0 * font + max(widths, default=0.0)))
|
|
93
|
+
|
|
94
|
+
|
|
47
95
|
def _with_legend(
|
|
48
96
|
image: np.ndarray,
|
|
49
97
|
background: Any,
|
|
@@ -52,13 +100,21 @@ def _with_legend(
|
|
|
52
100
|
colors: Any = (),
|
|
53
101
|
title: str = "",
|
|
54
102
|
bar: tuple[float, float, str] | None = None,
|
|
103
|
+
column: int,
|
|
55
104
|
) -> np.ndarray:
|
|
56
|
-
"""The picture with a
|
|
105
|
+
"""The picture with a column of this width at its left, in the color of
|
|
106
|
+
the background, and a legend at the top left: names with colors, or a bar
|
|
57
107
|
from the low to the high value of a colormap."""
|
|
58
|
-
height
|
|
59
|
-
|
|
108
|
+
height = image.shape[0]
|
|
109
|
+
side = np.zeros((height, column, 4), dtype=image.dtype)
|
|
110
|
+
if background is not None:
|
|
111
|
+
side[:, :, :3] = np.rint(255.0 * _color(background))
|
|
112
|
+
side[:, :, 3] = 255
|
|
113
|
+
image = np.concatenate([side, image], axis=1)
|
|
114
|
+
width = image.shape[1]
|
|
115
|
+
font = _font(height)
|
|
60
116
|
points = font * 0.72 # at 100 dots per inch
|
|
61
|
-
behind = np.
|
|
117
|
+
behind = np.ones(3) if background is None else _color(background)
|
|
62
118
|
ink = np.zeros(3) if behind.mean() > 0.5 else np.ones(3)
|
|
63
119
|
x, y = font, font
|
|
64
120
|
|