-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verification #133
Closed
Closed
Verification #133
Changes from 27 commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
f44b925
Adds verification cli
domna 4739463
Simple working verification
domna de27590
Don't replace non-variadic group names
domna 712dbd4
Happyfy linting
domna 0ae9671
Adds support for bytes NX_class attributes
domna 09d3b4b
Autoformatting
domna 43c65a9
Cleanup
domna fcd1c43
Adds nexus unit registry
domna 4200c71
Fixes linting
domna 16b070f
Sets defs to latest fairmat
domna 1671a13
Adds basic unit check
domna 20efda4
Check general validity of units
domna cca87bc
Resolve also parents for units
domna 9dfbd03
Merge commit '0c69581b014d0ef7a65e54e9cc8a2e25916c26c8' into verifica…
domna 5c2dd4e
autoformat
domna 2f520cc
Merge commit '8bd900e8c520dacc67ef7b644d29dba1d5fe221e' into verifica…
domna 529331f
Adds missing import
domna 7c95311
Merge branch 'master' into verification
domna 33cb7fd
Merge branch 'master' into verification
domna 13e2670
Update to latest definitions
domna 7413bae
Allow more genaral uppercase notation in nx_namefit
domna 9ccb7b4
Add proper unit retrieval in validation
domna 0c6fb6c
Lower debug level
domna e2a167a
Add counts to units
domna 199024a
Fix namefitting
domna 8f8df03
Adds support for NX_TRANSFORMATION
domna c44f5b8
Fix units in example data and tests
domna 42904b9
Fix NOT IN SCHEMA for mpes example
domna cac78c6
Fix uppercase attribute namefit
domna 06190b7
Keep uppercase parts in hdf names
domna 49a7e1f
Fix upper/lower notation for example
domna 11892d4
Re-enable empty-required-field test
domna 4105ba5
don't use removeprefix
domna 2d352cf
Fix empty-required-field test
domna 7b1ec45
Properly check error logs
domna 7c449cb
Catch errors for validate data dict
domna 9312b3e
Fix required lone group in template
domna 53c1849
Removes unecessary function
domna 16e2d37
Adds proper uppercase matching to path in data dict check
domna 45ee476
Cleans unit attributes
domna a139a40
Fix typing
domna f98994a
Fix local linting
domna e9ecd30
Update definitions
domna 9a98967
Update nexus version file
domna c4ef94f
Updates generated eln file
domna 1cf6a50
Updates reference files
domna 00b7637
Do file checks in verification cli
domna 52fca4e
Don't fail if definition is not present
domna 08a3b81
Updates definitions
domna 6d11276
Merge branch 'master' into verification
domna d4655fe
Add required under optional in group
domna 1755347
rename to field
domna debcf51
Fix other tests
domna d632535
Check required field provided
domna b4686fc
Fix all_required_children_are_set
domna d761f37
Merge branch 'master' into fix-required-under-optional
domna 10b1c44
Fix tests
domna d4dc235
Use if checks instead of try..except
domna 1c68848
Add routine to check required fields for repeating groups
domna feb973e
Delete temporary file
domna 17eb061
Fix path in data dict test
domna d83a6b8
Fix tests
domna b3a0f1b
Cleanup
domna 0c9a0f4
Remove debugging line
domna dcb4d9b
Add collector class
domna 56bf3a6
Remove commented lines
domna a0ae259
Check validation return type and logging
domna 46f122b
Add tests for repeating groups
domna 2b0144f
Fix report of variadic groups set to all None
domna 9e29d5d
Merge branch 'master' into verification
domna 59106f2
Merge branch 'fix-required-under-optional' into verification
domna 617d86f
Add validity report at the end
domna bd98fad
Add validation logging for units
domna 2529789
Fixes undocumented units and reporting of all none required groups
domna f7a64db
Use dict paths everywhere
domna 59b1798
Add pint to dependencies
domna e6dad7c
Catch and log undefined units
domna 7734256
Add unit checks for nx transformations
domna b55ebcc
Log wrong transformation_type
domna 1261e6a
Merge branch 'master' into verification
domna 485ffd9
Renaming
domna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Copyright The NOMAD Authors. | ||
# | ||
# This file is part of NOMAD. See https://nomad-lab.eu for further info. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
"""A unit registry for nexus units""" | ||
|
||
import os | ||
from pint import UnitRegistry | ||
|
||
ureg = UnitRegistry(os.path.join(os.path.dirname(__file__), "default_en.txt")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Default Pint constants definition file | ||
# Based on the International System of Units | ||
# Language: english | ||
# Source: https://physics.nist.gov/cuu/Constants/ | ||
# https://physics.nist.gov/PhysRefData/XrayTrans/Html/search.html | ||
# :copyright: 2013,2019 by Pint Authors, see AUTHORS for more details. | ||
|
||
#### MATHEMATICAL CONSTANTS #### | ||
# As computed by Maxima with fpprec:50 | ||
|
||
pi = 3.1415926535897932384626433832795028841971693993751 = π # pi | ||
tansec = 4.8481368111333441675396429478852851658848753880815e-6 # tangent of 1 arc-second ~ arc_second/radian | ||
ln10 = 2.3025850929940456840179914546843642076011014886288 # natural logarithm of 10 | ||
wien_x = 4.9651142317442763036987591313228939440555849867973 # solution to (x-5)*exp(x)+5 = 0 => x = W(5/exp(5))+5 | ||
wien_u = 2.8214393721220788934031913302944851953458817440731 # solution to (u-3)*exp(u)+3 = 0 => u = W(3/exp(3))+3 | ||
|
||
#### DEFINED EXACT CONSTANTS #### | ||
|
||
speed_of_light = 299792458 m/s = c = c_0 # since 1983 | ||
planck_constant = 6.62607015e-34 J s = h # since May 2019 | ||
elementary_charge = 1.602176634e-19 C = e # since May 2019 | ||
avogadro_number = 6.02214076e23 # since May 2019 | ||
boltzmann_constant = 1.380649e-23 J K^-1 = k = k_B # since May 2019 | ||
standard_gravity = 9.80665 m/s^2 = g_0 = g0 = g_n = gravity # since 1901 | ||
standard_atmosphere = 1.01325e5 Pa = atm = atmosphere # since 1954 | ||
conventional_josephson_constant = 4.835979e14 Hz / V = K_J90 # since Jan 1990 | ||
conventional_von_klitzing_constant = 2.5812807e4 ohm = R_K90 # since Jan 1990 | ||
|
||
#### DERIVED EXACT CONSTANTS #### | ||
# Floating-point conversion may introduce inaccuracies | ||
|
||
zeta = c / (cm/s) = ζ | ||
dirac_constant = h / (2 * π) = ħ = h_bar = atomic_unit_of_action = a_u_action | ||
avogadro_constant = avogadro_number * mol^-1 = N_A | ||
molar_gas_constant = k * N_A = R | ||
faraday_constant = e * N_A | ||
conductance_quantum = 2 * e ** 2 / h = G_0 | ||
magnetic_flux_quantum = h / (2 * e) = Φ_0 = Phi_0 | ||
josephson_constant = 2 * e / h = K_J | ||
von_klitzing_constant = h / e ** 2 = R_K | ||
stefan_boltzmann_constant = 2 / 15 * π ** 5 * k ** 4 / (h ** 3 * c ** 2) = σ = sigma | ||
first_radiation_constant = 2 * π * h * c ** 2 = c_1 | ||
second_radiation_constant = h * c / k = c_2 | ||
wien_wavelength_displacement_law_constant = h * c / (k * wien_x) | ||
wien_frequency_displacement_law_constant = wien_u * k / h | ||
|
||
#### MEASURED CONSTANTS #### | ||
# Recommended CODATA-2018 values | ||
# To some extent, what is measured and what is derived is a bit arbitrary. | ||
# The choice of measured constants is based on convenience and on available uncertainty. | ||
# The uncertainty in the last significant digits is given in parentheses as a comment. | ||
|
||
newtonian_constant_of_gravitation = 6.67430e-11 m^3/(kg s^2) = _ = gravitational_constant # (15) | ||
rydberg_constant = 1.0973731568160e7 * m^-1 = R_∞ = R_inf # (21) | ||
electron_g_factor = -2.00231930436256 = g_e # (35) | ||
atomic_mass_constant = 1.66053906660e-27 kg = m_u # (50) | ||
electron_mass = 9.1093837015e-31 kg = m_e = atomic_unit_of_mass = a_u_mass # (28) | ||
proton_mass = 1.67262192369e-27 kg = m_p # (51) | ||
neutron_mass = 1.67492749804e-27 kg = m_n # (95) | ||
K_alpha_Cu_d_220 = 0.80232719 # (22) | ||
K_alpha_Mo_d_220 = 0.36940604 # (19) | ||
K_alpha_W_d_220 = 0.108852175 # (98) | ||
|
||
#### DERIVED CONSTANTS #### | ||
|
||
fine_structure_constant = (2 * h * R_inf / (m_e * c)) ** 0.5 = α = alpha | ||
vacuum_permeability = 2 * α * h / (e ** 2 * c) = µ_0 = mu_0 = mu0 = magnetic_constant | ||
vacuum_permittivity = e ** 2 / (2 * α * h * c) = ε_0 = epsilon_0 = eps_0 = eps0 = electric_constant | ||
impedance_of_free_space = 2 * α * h / e ** 2 = Z_0 = characteristic_impedance_of_vacuum | ||
coulomb_constant = α * h_bar * c / e ** 2 = k_C | ||
classical_electron_radius = α * h_bar / (m_e * c) = r_e | ||
thomson_cross_section = 8 / 3 * π * r_e ** 2 = σ_e = sigma_e | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be imported from pynxtools.definitions.dev_tools.utils.nxdl_utils