Skip to main content

Automated Descriptor Engine for SNCI, SCDI, and 9D KNF

Project description

KNF-CORE

KNF-CORE is an automated computational chemistry pipeline for generating KNF descriptors from molecular structure files. It combines xTB + Multiwfn + custom post-processing to produce:

  • SNCI
  • SCDI variance
  • 9D KNF vector (f1 ... f9)

Version

Current package version in this branch: 1.0.1

What This Branch Includes

  • Automatic input conversion to XYZ when needed (via Open Babel)
  • Single-file and directory processing modes
  • Auto-configured multi-worker batch mode
  • Dockerized runtime (Dockerfile, docker-compose.yml, container entrypoint)
  • Updated fragment handling rules

Fragment behavior:

  • 1 fragment: f1 = 0.0, f2 = 180.0
  • 2 fragments: f1 = COM distance, f2 = detected H-bond angle
  • >2 fragments: f1 = average COM distance over all unique pairs, f2 = 180.0

Requirements

  • Python >=3.8
  • xtb in PATH
  • obabel (Open Babel) in PATH
  • Multiwfn in PATH

Install

From PyPI:

pip install KNF

From source:

git clone https://github.com/Prasanna163/KNF.git
cd KNF
pip install .

CLI Usage

Basic run:

knf input_molecule.sdf

Useful options:

  • --charge <int>: total charge (default 0)
  • --spin <int>: multiplicity (default 1)
  • --force: recompute stages
  • --clean: remove prior working folder for that input
  • --debug: verbose logging
  • --processing <single|multi> (alias: --processes)
  • --workers <int>: explicit workers for multi mode
  • --output-dir <path>: custom results root
  • --ram-per-job <MB>: RAM hint for auto worker selection
  • --refresh-autoconfig: regenerate auto-config cache

Example:

knf example.mol --charge 0 --force

Directory batch example:

knf ./molecules --processing multi --force

Python API

from knf_core.pipeline import KNFPipeline

pipeline = KNFPipeline(
    input_file="test.sdf",
    charge=0,
    spin=1,
)
pipeline.run()

Output Layout

Default output root:

  • File input: <input_parent>/Results/<input_stem>/
  • Directory input: <input_dir>/Results/<file_stem>/

Typical output files:

  • knf.json
  • output.txt
  • xtbopt.xyz
  • xTB/Multiwfn intermediates (wbo, molden.input, nci_grid.txt, etc.)

Batch mode also writes:

  • batch_knf.json at the batch Results root, containing:
    • per-input status/error/timing
    • embedded content of each successful knf.json
    • a combined knf_results list for ML training pipelines

Docker

Quick run:

docker build -t knf-core:latest .
docker run --rm -v "$(pwd):/work" -w /work knf-core:latest example.mol --charge 0 --force

Compose:

docker compose up --build

Full Docker documentation is in README.DOCKER.md.

Releasing

PyPI release steps are documented in RELEASE.md.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

knf-1.0.1.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knf-1.0.1-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file knf-1.0.1.tar.gz.

File metadata

  • Download URL: knf-1.0.1.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for knf-1.0.1.tar.gz
Algorithm Hash digest
SHA256 744b5596cb75874471934ac97df578b53f1e244a64166dc5fb6bcbf89f41a364
MD5 66efa80e66eb6f79f8c1571595993422
BLAKE2b-256 c2c27ee4fe66e7237253920655596728318e8a61d3a125b09037b31b24f68a13

See more details on using hashes here.

File details

Details for the file knf-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: knf-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for knf-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 950318f17166fd9be8cf2db1220b28a8b9cf4f53ec57a9497528d8a6606055f5
MD5 ee907642330e041b19a5e0e4973725d6
BLAKE2b-256 f4a9465ad7d2d2db548da72c997abb82aa74e68e58a2e45101aa3b51a6441c61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page