Skip to main content

Reads first-principle molecular simulation data and graphs various statistics

Project description

FPdataViewer

Reads first-principle atomic structures files and graphs various statistics to provide a small overview of the file's content using matplotlib. Built around VASP MLFF input and output files: ML_AB and ML_ABN. Either saves to a PDF file (plot) or launches matplotlib (plot --interactive).

Also provides some tools for converting between file types using ASE (convert), repairing broken files (validate), and quickly inspecting the contents files (inspect). Some of these tools are also provided by the ASE CLI, and will become obsolete when the vasp-mlab format is implemented).

front page image page
atom type page for bismuth atom type page for oxygen

Table of contents

Installation

pip

The easiest method is to install through pip.

pip install fpdataviewer

Installation through pip is the preferred method, but will pull in a number of large libraries used in analysis, some of which may not be supported on Windows. If this is not preferable, consider installing with --no-deps and using --skip to avoid said libraries (see requirements and options).

conda

# NOT CURRENTLY AVAILABLE

Requirements

Not all dependencies are required when --skip is used.

Component Dependencies (immediate)
required numpy pandas matplotlib seaborn
radial distribution functions numba
descriptors scikit-learn dscribe (possible compatability issues)
rendering ovito PySide6 Pillow

Usage

fpdataviewer plot

Main functionality. Graphs statistics into pdf or onto screen (with `--interactive``).

# Basic PDF generation
fpdataviewer plot -i examples/ML_AB -o overview.pdf

# Interactive plots
fpdataviewer plot -i examples/ML_AB --interactive

# Specify custom config
fpdataviewer plot -i examples/ML_AB --config mlab_viewer.json

# Skip radial distribution functions and image rendering, rasterize remaining graphs
fpdataviewer plot --rasterize --skip rdf img
Options
--interactive, -x

Save to a PDF file (pdf, default), show interactive plots (plt), or only print to console (none).

--config <file>, -c

See Config file.

--skip <rdf/desc/img>, -s

Skip calculations for radial distribution functions (rdf), descriptors (desc), or image rendering (img). Multiple can be selected. Useful when only certain statistics are needed.

--strict, -t

Validates the input file. Some formats (like VASP's ML_AB) contain redundant or possibly self-contradictory information that can cause parsers to fail unpredictably. This option will check the input file against specifications to minimize these errors and help the user repair the broken file.

--rasterize, -r

Disables vector image format for plots and uses raster images. This can greatly reduce file size when many descriptors are being drawn. Simply feeds rasterize=True to matplotlib.

fpdataviewer inspect

Summarized file contents to console, no analysis. Recommened to use before plotting large files.

fpdataviewer inspect -i examples/ML_AB
Options
--strict, -t

Validates the input file. See fpdataviewer validate.

fpdataviewer convert

Converts between file types using ASE. Useful for reading ML_AB files, otherwise recommended to use ASE CLI directly instead.

# Convert first structure in ML_AB file to a POSCAR file
fpdataviewer convert -i examples/ML_AB -o examples/POSCAR -f vasp-mlab -t vasp -x 0
Options
--from, -f

Source format; see ASE documentation for options. Use vasp-mlab for ML_AB format.

--to, -t

Target format; see ASE documentation for options.

--index, -x

Selects range of structures from source, in Python slice format (e.g. 0 for the first structure, -1 for the last, :4 for the first four, etc.).

--append, -a

Appends to end of the target file instead of overwriting.

fpdataviewer validate

Validates the input file and reports problems. Some formats (like VASP's ML_AB) contain redundant or possibly self-contradictory information that can cause parsers to fail unpredictably. This option will check the input file against specifications to minimize these errors and help the user repair the broken file.

fpdataviewer validate -i examples/ML_AB

Config file

Specifying a custom config will override settings from the default, which is located in config.py.

{
  "global": {
    "bins": 100
  },
  "rdf": {
    "bins": 1000,
    "structures": 1.0,
    "r_min": 0.0,
    "r_max": "auto",
    "skip_pairs": []
  },
  "descriptors": {
    "structures": 1.0,
    "soap": {
      "r_cut": "auto",
      "n_max": 8,
      "l_max": 8
    }
  },
  "rendering": {
    "width": 1024,
    "height": 1024
  }
}

Most settings are self-explanatory, but more specifically:

  • "descriptors"
    • See DScribe documentation. The inner content is fed to the respective (local) descriptor object. It should specify one of
      • "soap"
      • "acsf"
      • "lmbtr"
  • "rdf"
    • "skip_pairs" is an array of values "<atom 1>-<atom 2>" (e.g. "Bi-O"). Usually RDF calculations are fast enough for this to be unnecessary.
  • Anywhere
    • "structures" specify the number of structures to be included in some calculation, chosen at random. It should specify
      • 0.0 < x < 1.0 for a portion
      • x > 1 for a specific number
    • "auto" will be replaced with the maximum possible radius such that radii never overlap in a periodic structure (the non periodic distance in the overview panel).

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

fpdataviewer-1.0.1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

fpdataviewer-1.0.1-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fpdataviewer-1.0.1.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for fpdataviewer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e3ae3cdb373147e05010a17e00eb8d7bf69764e54f28e94c94abe88f68a2c01b
MD5 3d8fc32ffe43e232e8b825fad1b292ab
BLAKE2b-256 448788e455844815687f40fbed6c1e35b69237c3d8920ea3ef0e33d990d39692

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fpdataviewer-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for fpdataviewer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 31bb04118966e12491804983ea7b318cbec9f26ea1b7d3a10f676c931f09f501
MD5 b133f37d6aadbdd2cd1020bec3e44075
BLAKE2b-256 021074ddcf58d0d628e3070bd9ebb05da56b186746e3e4b30186fddb69fd4c83

See more details on using hashes here.

Supported by

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