Skip to main content

Sphractal

ci-cd

Description

Sphractal is a package that provides functionalities to estimate the fractal dimension of complex 3D surfaces formed from overlapping spheres via box-counting algorithm.

Background

  • Atomic objects in molecular and nanosciences such are often represented as collection of spheres with radii associated with the atomic radius of the individual component.

  • Some examples of these objects (inclusive of both fine- and coarse-grained representation of the individual components) are small molecules, proteins, nanoparticles, polymers, and porous materials such as zeolite, metal-organic framework (MOFs).
  • The overall properties of these objects are often significantly influenced by their surface properties, in particular the surface area available for interaction with other entities, which is related to the surface roughness.
  • Fractal dimension allows the surface complexity/roughness of objects to be measured quantitatively.
  • The fractal dimension could be estimated by applying the box-counting algorithm on surfaces represented as either:
    • approximated point cloud:

  • that are subsequently voxelised:

  • or mathematically exact surfaces:

Features

Aims

  • Representation of the surface as either voxelised point clouds or mathematically exact surfaces.
  • Efficient algorithm for 3D box-counting calculations.
  • Customisable parameters to control the level of detail and accuracy of the calculation.

Installation

Use pip or conda to install Sphractal:

pip install sphractal
conda install -c conda-forge sphractal

Special Requirement for Point Cloud Surface Representation

Sphractal requires a file compiled from another freely available repository for the functionalities related to voxelised point clouds surface representation to operate properly.

This could be done by:

  • Downloading the source code from the repository to a directory of your choice:
git clone https://github.com/jon-ting/fastbc.git
  • Compile the code into an executable file (which works on any operating system) by doing either one of the following compilations according to the instructions on the README.md page. This will decide whether you will be running the box counting algorithm with GPU acceleration. Feel free to rename the output file from the compilation:
g++ 3DbinImBCcpu.cpp bcCPU.cpp -o 3DbinImBCcpu
nvcc -O3 3DbinImBCgpu.cpp bcCUDA3D.cu -o 3DbinImBCgpu
  • (Optional) Setting the path to the compiled file as an environment variable accessible by Python (replace <PATH_TO_FASTBC> by the absolute path to the executable file you just built), otherwise you could always pass the path to the compiled file to the relevant functions:
export FASTBC=<PATH_TO_FASTBC>

Note that for the environment variable to be persistent (to still exist after the terminal is closed), the line should be added to your ~/.bashrc.

Usage

from sphractal import getExampleDataPath, runBoxCnt

inpFile = getExampleDataPath()  # Replace with the path to your xyz or lmp file
boxCntResults = runBoxCnt(inpFile)

Check out the basic demonstration and application demonstration notebooks for further explanations and demonstrations!

Documentation

Detailed documentations are hosted by Read the Docs.

Contributing

Sphractal appreciates your enthusiasm and welcomes your expertise!

Please check out the contributing guidelines and code of conduct. By contributing to this project, you agree to abide by its terms.

License

The project is distributed under an MIT License.

Credits

The package was created with cookiecutter using the py-pkgs-cookiecutter template. The speeding up of the inner functions via just-in-time compilations with Numba was inspired by the advice received during the NCI-NVIDIA Open Hackathon 2023.

Contact

Email: Jonathan.Ting@anu.edu.au/jonting97@gmail.com

Feel free to reach out if you have any questions, suggestions, or feedback.

Metadata

Release files for sphractal 1.1.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphractal 1.1.17
File Size Uploaded Provenance Actions
sphractal-1.1.17.tar.gz 914.9 kB Without provenance Details for sphractal-1.1.17.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sphractal 1.1.17
File Interpreter ABI Platform Actions
sphractal-1.1.17-py3-none-any.whl Python 3 none any Details for sphractal-1.1.17-py3-none-any.whl

Total release size: 1.8 MB

Release files / sphractal-1.1.17.tar.gz

Download URL sphractal-1.1.17.tar.gz
Size 914.9 kB
Tags Source
SHA-256 checksum
How to use checksums
57dde7d838c0c22736edd76d82c2bbbf45b3aa894e0cb825d0853ea11581fcb0
BLAKE2b-256 checksum
How to use checksums
7347f368155ce02b905c5c597890ccbc9521e93bc69a76db8e6efa39ccaccb5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / sphractal-1.1.17-py3-none-any.whl

Download URL sphractal-1.1.17-py3-none-any.whl
Size 904.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ed8a4a10c7588551b5d84ccf5ed78e7c5c3ebf1bfd56183196c97f0475c008a
BLAKE2b-256 checksum
How to use checksums
feb4bdd306a27c7217ab66a6ed9a4c9c468130642df55c952ebb03574bee029f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for sphractal 1.1.17

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page