openmicroanalysis / pyxray

Definitions and properties of X-ray transitions
MIT License
6 stars 4 forks source link

Restructuring #4

Closed ppinard closed 7 years ago

ppinard commented 7 years ago

As part of issue #2 and the definition of SQL tables, here is a draft how to restructure the pyxray library.

Build

Here are the descriptors required by pyxray and their definition:

There is a finite set for each descriptors (e.g. 118 elements, 7 atomic shells, etc.). From a programming point of view, the descriptors should therefore be:

There is no limit on the number of properties that can be defined by combining descriptors. Some examples

In all cases, a reference descriptor should be provided to identify the source of the values.

Implementation

def get_transition_energy_eV(element, transition, reference=None):
    ...
def get_element_symbol(element, reference=None):
    ...
ppinard commented 7 years ago

Definition of the parser (here) and a few implementations (here) including the use of request_cache library to cache download from Wikipedia.