Skip to content

Releases: Baharis/hikari

v0.1.2 - Improvements to paths and groups

04 Nov 19:52
Compare
Choose a tag to compare

Since hikari is focused on handling complicated matters using syntax as simple as possible, it is of utmost importance to keep existing code as simple as possible, even if it is a subject to further changes. In this patch a lot of attention was focused on increasing the clarity and ease of use in existing tools.

In particular, instances of hikari.symmetry.Group are now more identifiable, as now each has an associated Group.number and Group.name. The name is by default fixed, but one can also use Group.auto_generated_name. This property is far from perfect, but can help one understand the basic nature of groups, which now can have non-standard base and setting when created using new Group.transform method.

Minor corrections have been also introduced to hikari.utility module and associated scripts. Most importantly, the pathing capability was redirected to new make_abspath function, which does not relies on Path module instead of os and correctly interprets both absolute and relative path even with symbols such as ~, making previous tools obsolete.

Changes:

  • hikari.symmetry.Group has new properties name, number, auto_generated_name, is_symmorphic and method transform;
  • hikari.utility.os_tools has new make_abspath function which interprets absolute and relative paths even with symbols;
  • Both point and space groups are now stored in pickles, which can be regenerated based on reintroduced .csv files;
  • hikari.scripts.potency_violin_plot now appends descriptive statistics at the end of its log;
  • Other minor corrections in code and documentation of hikari.symmetry.Group were performed;
  • Several obsolete and legacy code and documentation fragments were removed.

Full Changelog: v0.1.1...v0.1.2

v0.1.1 - significant performance improvements

20 Oct 17:38
Compare
Choose a tag to compare

One of the largest limitations of hikari has always been its speed. Since all functions of the library are written in pure python and often require performing thousands of identical operations, achieving a satisfactory speed requires relying on numpy and pandas vectorised functionality as much as possible.

One of those functions, panda's nunique used to determine number of unique reflections in HklFrame.data table tends to work much faster for simple data types, such as integers. Until now, symmetry equivalence was stored using (h,k,l) tuple containing indices of one of the equivalent reflections. This is now stored as a concatenated h00k00l integer instead, which slightly reduces readability, but significantly speeds up scripts looking for pattern symmetry.

Small changes were also made to the way group lists are stored as well as how completeness for violin plots is calculated. In particular, large point and space group dictionaries are now stored in pickles instead of csv or being generated each time, which significantly shortens the import times, but can introduce potential security issues in the future.

A short comparison of execution times in previous and current version has been presented below:

  • package import time: average execution time 3.57 seconds → 0.43 second;
  • highest quality potency map, Pnma, 8000 ų cell using MoKα to 0.83 Å: 219 seconds → 124 seconds;
  • 10000-points precise violin plot, 8000 ų cell using MoKα to 0.83 Å: 66 minutes → 26 minutes.

In particular, good quality maps (2° increment) for cubic system could be generated in less then a minute, which makes embedding program capabilities into web page, similarly to CheckCIF or SHADE, more then feasible. As a side effect, minimum and maximum potency calculated using new functions was found to be sometimes up to 0.05% higher then before (most likely due to resolution overestimates not being removed in one of the trimming steps due to floating point error), which is not worrying since the mean and distribution quartiles remain identical for all practical purposes.

Changes:

  • Changed equivalence "hash" type from tuple containing hkl reflection with maximal indices to integer;
  • Renamed completeness_ functions to potency_*, divided scripts into 3 files & slightly optimised them;
  • Saved point and space group dictionaries PG & SG as pickles and implemented loading functions;
  • Abbreviated Group.CrystalSystem enumenator to Group.System;
  • Removed legacy directory and some depreciated functions such as is2n from utility.maths;
  • Extended and modified selected docstrings, rewritten some minor dataframe code to be more clear.

Full Changelog: v0.1.0...v0.1.1

Initial release: v0.1.0

13 Oct 18:20
Compare
Choose a tag to compare
Pre-release

Initial alpha release of hikari - toolkit for crystallographic files analysis and manipulation. This project has been previously kept private under the name 'kesshou'. It has been released to public 13th of October, 2021 under MIT license.

While hikari offers much more functionality then can be specified on a short list, its general use boils up to:

  • Reading, reformatting, interpreting and writing .hkl (and by extension .fcf) reflection files;
  • Visualising .hkl files in 2D as well as exporting them to .res file in order to visualise them in Mercury;
  • Importing basic crystallographic information from .cif and .res files;
  • Analysing .fcf files for basic crystallographic statistics, as well as some more advanced ones;
  • Analysing existing .hkl files and predict statistics for theoretical ones in high-pressure experiment conditions.

Full Changelog: https://github.com/Baharis/hikari/commits/v0.1.0