chemicalml 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +23 -0
- data/CLAUDE.md +49 -1
- data/README.adoc +154 -26
- data/TODO.align/61-parallel-array-attrs.md +54 -0
- data/TODO.align/62-per-element-attribute-gaps.md +49 -0
- data/TODO.align/63-universal-children-mixin.md +42 -0
- data/TODO.align/64-per-element-child-gaps.md +81 -0
- data/TODO.align/65-simple-unit-convention.md +40 -0
- data/TODO.align/66-schema24-legacy-children.md +32 -0
- data/TODO.align/67-final-verification.md +32 -0
- data/TODO.align/68-detection-coverage.md +33 -0
- data/TODO.align/69-json-yaml-roundtrip.md +27 -0
- data/TODO.align/70-iterative-walker.md +40 -0
- data/TODO.align/71-violation-value.md +25 -0
- data/TODO.align/72-close-child-gaps.md +66 -0
- data/TODO.align/73-schema24-parse-limitation.md +64 -0
- data/TODO.align/74-final-verification-round18.md +15 -0
- data/TODO.align/75-key-value-mappings.md +43 -0
- data/TODO.align/76-schema24-workaround.md +57 -0
- data/TODO.align/77-convention-coverage-matrix.md +31 -0
- data/TODO.align/78-fixture-audit.md +23 -0
- data/TODO.align/79-final-verification-round19.md +15 -0
- data/TODO.align/80-xsd-enum-constants.md +35 -0
- data/TODO.align/81-enum-validation-constraints.md +29 -0
- data/TODO.align/82-reference-resolver.md +33 -0
- data/TODO.align/83-toml-roundtrip.md +20 -0
- data/TODO.align/84-final-verification-round21.md +16 -0
- data/TODO.align/85-bond-distinct-atoms.md +25 -0
- data/TODO.align/86-references-should-resolve.md +20 -0
- data/TODO.align/87-cli-utility.md +26 -0
- data/TODO.align/88-diverse-fixtures.md +26 -0
- data/TODO.align/89-final-verification-round22.md +15 -0
- data/TODO.align/90-bond-stereo-completeness.md +31 -0
- data/TODO.align/91-atomparity-distinct.md +21 -0
- data/TODO.align/92-unit-dictionary-completeness.md +28 -0
- data/TODO.align/93-yard-docs.md +23 -0
- data/TODO.align/94-final-verification-round23.md +15 -0
- data/TODO.align/README.round17.md +28 -0
- data/TODO.align/README.round18.md +37 -0
- data/TODO.align/README.round19.md +40 -0
- data/TODO.align/README.round20.md +49 -0
- data/TODO.align/README.round21.md +35 -0
- data/TODO.align/README.round22.md +48 -0
- data/TODO.align/README.round23.md +46 -0
- data/TODO.align/README.round24.md +53 -0
- data/TODO.align/README.round25.md +66 -0
- data/TODO.align/README.round26.md +55 -0
- data/TODO.align/README.round27.md +51 -0
- data/TODO.align/README.round28.md +61 -0
- data/TODO.align/README.round29.md +64 -0
- data/TODO.align/README.round30.md +50 -0
- data/TODO.align/README.round31.md +54 -0
- data/TODO.align/README.round32.md +67 -0
- data/TODO.align/README.round33.md +62 -0
- data/TODO.align/README.round34.md +70 -0
- data/docs/constraints.md +161 -0
- data/docs/generate_constraint_docs.rb +44 -0
- data/exe/chemicalml +6 -0
- data/lib/chemicalml/cli/base.rb +68 -0
- data/lib/chemicalml/cli/command.rb +43 -0
- data/lib/chemicalml/cli/constraints_command.rb +27 -0
- data/lib/chemicalml/cli/conventions_command.rb +14 -0
- data/lib/chemicalml/cli/dictionaries_command.rb +14 -0
- data/lib/chemicalml/cli/elements_command.rb +17 -0
- data/lib/chemicalml/cli/enums_command.rb +17 -0
- data/lib/chemicalml/cli/info_command.rb +77 -0
- data/lib/chemicalml/cli/inspect_command.rb +39 -0
- data/lib/chemicalml/cli/validate_command.rb +54 -0
- data/lib/chemicalml/cli.rb +43 -0
- data/lib/chemicalml/cml/base/abundance.rb +18 -8
- data/lib/chemicalml/cml/base/action.rb +34 -16
- data/lib/chemicalml/cml/base/action_list.rb +35 -17
- data/lib/chemicalml/cml/base/alternative.rb +13 -4
- data/lib/chemicalml/cml/base/amount.rb +14 -6
- data/lib/chemicalml/cml/base/angle.rb +28 -13
- data/lib/chemicalml/cml/base/annotation.rb +14 -6
- data/lib/chemicalml/cml/base/any_cml.rb +12 -5
- data/lib/chemicalml/cml/base/appinfo.rb +14 -6
- data/lib/chemicalml/cml/base/arg.rb +47 -13
- data/lib/chemicalml/cml/base/array.rb +40 -19
- data/lib/chemicalml/cml/base/array_list.rb +14 -6
- data/lib/chemicalml/cml/base/atom.rb +84 -28
- data/lib/chemicalml/cml/base/atom_array.rb +60 -23
- data/lib/chemicalml/cml/base/atom_parity.rb +14 -6
- data/lib/chemicalml/cml/base/atom_set.rb +14 -6
- data/lib/chemicalml/cml/base/atom_type.rb +25 -9
- data/lib/chemicalml/cml/base/atom_type_list.rb +22 -8
- data/lib/chemicalml/cml/base/atomic_basis_function.rb +33 -13
- data/lib/chemicalml/cml/base/band.rb +21 -8
- data/lib/chemicalml/cml/base/band_list.rb +15 -7
- data/lib/chemicalml/cml/base/basis_set.rb +24 -9
- data/lib/chemicalml/cml/base/bond.rb +36 -10
- data/lib/chemicalml/cml/base/bond_array.rb +34 -11
- data/lib/chemicalml/cml/base/bond_set.rb +14 -6
- data/lib/chemicalml/cml/base/bond_stereo.rb +20 -9
- data/lib/chemicalml/cml/base/bond_type.rb +23 -8
- data/lib/chemicalml/cml/base/bond_type_list.rb +22 -8
- data/lib/chemicalml/cml/base/cell_parameter.rb +28 -10
- data/lib/chemicalml/cml/base/cml_module.rb +36 -11
- data/lib/chemicalml/cml/base/common_children.rb +35 -0
- data/lib/chemicalml/cml/base/complex_object.rb +12 -5
- data/lib/chemicalml/cml/base/condition_list.rb +26 -10
- data/lib/chemicalml/cml/base/crystal.rb +26 -10
- data/lib/chemicalml/cml/base/definition.rb +12 -5
- data/lib/chemicalml/cml/base/description.rb +14 -6
- data/lib/chemicalml/cml/base/dictionary.rb +27 -10
- data/lib/chemicalml/cml/base/dictionary_entry.rb +67 -8
- data/lib/chemicalml/cml/base/dimension.rb +26 -12
- data/lib/chemicalml/cml/base/document.rb +18 -8
- data/lib/chemicalml/cml/base/documentation.rb +12 -5
- data/lib/chemicalml/cml/base/eigen.rb +32 -8
- data/lib/chemicalml/cml/base/electron.rb +26 -12
- data/lib/chemicalml/cml/base/enumeration.rb +16 -7
- data/lib/chemicalml/cml/base/expression.rb +21 -6
- data/lib/chemicalml/cml/base/float.rb +22 -10
- data/lib/chemicalml/cml/base/float_array.rb +24 -11
- data/lib/chemicalml/cml/base/formula.rb +31 -10
- data/lib/chemicalml/cml/base/fragment.rb +30 -12
- data/lib/chemicalml/cml/base/fragment_list.rb +24 -9
- data/lib/chemicalml/cml/base/gradient.rb +19 -6
- data/lib/chemicalml/cml/base/identifier.rb +18 -8
- data/lib/chemicalml/cml/base/integer.rb +22 -10
- data/lib/chemicalml/cml/base/integer_array.rb +24 -11
- data/lib/chemicalml/cml/base/isotope.rb +28 -9
- data/lib/chemicalml/cml/base/isotope_list.rb +17 -8
- data/lib/chemicalml/cml/base/join.rb +25 -9
- data/lib/chemicalml/cml/base/kpoint.rb +16 -7
- data/lib/chemicalml/cml/base/kpoint_list.rb +15 -7
- data/lib/chemicalml/cml/base/label.rb +14 -6
- data/lib/chemicalml/cml/base/lattice.rb +35 -10
- data/lib/chemicalml/cml/base/lattice_vector.rb +16 -7
- data/lib/chemicalml/cml/base/length.rb +26 -12
- data/lib/chemicalml/cml/base/line3.rb +18 -8
- data/lib/chemicalml/cml/base/link.rb +41 -20
- data/lib/chemicalml/cml/base/list.rb +22 -10
- data/lib/chemicalml/cml/base/map.rb +32 -11
- data/lib/chemicalml/cml/base/matrix.rb +32 -15
- data/lib/chemicalml/cml/base/mechanism.rb +20 -7
- data/lib/chemicalml/cml/base/mechanism_component.rb +14 -6
- data/lib/chemicalml/cml/base/metadata.rb +18 -8
- data/lib/chemicalml/cml/base/metadata_list.rb +27 -8
- data/lib/chemicalml/cml/base/molecule.rb +90 -26
- data/lib/chemicalml/cml/base/molecule_list.rb +26 -8
- data/lib/chemicalml/cml/base/name.rb +10 -4
- data/lib/chemicalml/cml/base/object.rb +18 -8
- data/lib/chemicalml/cml/base/observation.rb +16 -7
- data/lib/chemicalml/cml/base/operator.rb +14 -6
- data/lib/chemicalml/cml/base/parameter.rb +33 -13
- data/lib/chemicalml/cml/base/parameter_list.rb +27 -8
- data/lib/chemicalml/cml/base/particle.rb +20 -9
- data/lib/chemicalml/cml/base/peak.rb +71 -26
- data/lib/chemicalml/cml/base/peak_group.rb +62 -26
- data/lib/chemicalml/cml/base/peak_list.rb +24 -9
- data/lib/chemicalml/cml/base/peak_structure.rb +40 -13
- data/lib/chemicalml/cml/base/plane3.rb +14 -6
- data/lib/chemicalml/cml/base/point3.rb +14 -6
- data/lib/chemicalml/cml/base/potential.rb +17 -6
- data/lib/chemicalml/cml/base/potential_form.rb +30 -7
- data/lib/chemicalml/cml/base/potential_list.rb +15 -7
- data/lib/chemicalml/cml/base/product.rb +45 -10
- data/lib/chemicalml/cml/base/product_list.rb +29 -9
- data/lib/chemicalml/cml/base/property.rb +29 -11
- data/lib/chemicalml/cml/base/property_list.rb +23 -8
- data/lib/chemicalml/cml/base/reactant.rb +45 -10
- data/lib/chemicalml/cml/base/reactant_list.rb +29 -9
- data/lib/chemicalml/cml/base/reaction.rb +74 -20
- data/lib/chemicalml/cml/base/reaction_list.rb +23 -8
- data/lib/chemicalml/cml/base/reaction_scheme.rb +43 -13
- data/lib/chemicalml/cml/base/reaction_step.rb +30 -12
- data/lib/chemicalml/cml/base/reaction_step_list.rb +30 -11
- data/lib/chemicalml/cml/base/reactive_centre.rb +31 -6
- data/lib/chemicalml/cml/base/region.rb +20 -9
- data/lib/chemicalml/cml/base/related_entry.rb +11 -3
- data/lib/chemicalml/cml/base/sample.rb +30 -7
- data/lib/chemicalml/cml/base/scalar.rb +32 -15
- data/lib/chemicalml/cml/base/spectator.rb +25 -6
- data/lib/chemicalml/cml/base/spectator_list.rb +20 -7
- data/lib/chemicalml/cml/base/spectrum.rb +57 -18
- data/lib/chemicalml/cml/base/spectrum_data.rb +19 -9
- data/lib/chemicalml/cml/base/spectrum_list.rb +28 -9
- data/lib/chemicalml/cml/base/sphere3.rb +14 -6
- data/lib/chemicalml/cml/base/stmml.rb +12 -5
- data/lib/chemicalml/cml/base/string.rb +14 -6
- data/lib/chemicalml/cml/base/string_array.rb +22 -10
- data/lib/chemicalml/cml/base/substance.rb +36 -14
- data/lib/chemicalml/cml/base/substance_list.rb +29 -10
- data/lib/chemicalml/cml/base/symmetry.rb +31 -9
- data/lib/chemicalml/cml/base/system.rb +21 -10
- data/lib/chemicalml/cml/base/table.rb +38 -13
- data/lib/chemicalml/cml/base/table_cell.rb +12 -5
- data/lib/chemicalml/cml/base/table_content.rb +19 -9
- data/lib/chemicalml/cml/base/table_header.rb +15 -7
- data/lib/chemicalml/cml/base/table_header_cell.rb +22 -10
- data/lib/chemicalml/cml/base/table_row.rb +15 -7
- data/lib/chemicalml/cml/base/table_row_list.rb +15 -7
- data/lib/chemicalml/cml/base/tcell.rb +16 -7
- data/lib/chemicalml/cml/base/torsion.rb +28 -13
- data/lib/chemicalml/cml/base/transform3.rb +12 -5
- data/lib/chemicalml/cml/base/transition_state.rb +23 -5
- data/lib/chemicalml/cml/base/trow.rb +22 -6
- data/lib/chemicalml/cml/base/unit.rb +39 -16
- data/lib/chemicalml/cml/base/unit_list.rb +34 -12
- data/lib/chemicalml/cml/base/unit_type.rb +27 -10
- data/lib/chemicalml/cml/base/unit_type_list.rb +29 -11
- data/lib/chemicalml/cml/base/vector3.rb +14 -6
- data/lib/chemicalml/cml/base/xaxis.rb +30 -10
- data/lib/chemicalml/cml/base/yaxis.rb +30 -10
- data/lib/chemicalml/cml/base/z_matrix.rb +26 -5
- data/lib/chemicalml/cml/base.rb +139 -138
- data/lib/chemicalml/cml/canonical_comparison.rb +54 -0
- data/lib/chemicalml/cml/elements.rb +145 -136
- data/lib/chemicalml/cml/enums.rb +55 -0
- data/lib/chemicalml/cml/namespace.rb +2 -3
- data/lib/chemicalml/cml/patterns.rb +33 -0
- data/lib/chemicalml/cml/reference_resolver.rb +137 -0
- data/lib/chemicalml/cml/role.rb +138 -138
- data/lib/chemicalml/cml/schema24/configuration.rb +11 -1
- data/lib/chemicalml/cml/schema24.rb +139 -139
- data/lib/chemicalml/cml/schema3.rb +123 -123
- data/lib/chemicalml/cml/visitable.rb +77 -3
- data/lib/chemicalml/cml/wire_class_registry.rb +3 -3
- data/lib/chemicalml/cml.rb +163 -129
- data/lib/chemicalml/context_configuration.rb +4 -2
- data/lib/chemicalml/convention/cascade/constraints/reaction_scheme_must_have_content.rb +33 -0
- data/lib/chemicalml/convention/cascade/constraints/reaction_step_list_must_contain_steps.rb +31 -0
- data/lib/chemicalml/convention/cascade/constraints/reaction_step_must_have_reaction_or_lists.rb +33 -0
- data/lib/chemicalml/convention/cascade/constraints/reactive_centre_atom_refs_should_be_present.rb +34 -0
- data/lib/chemicalml/convention/cascade/constraints.rb +18 -0
- data/lib/chemicalml/convention/cascade.rb +43 -0
- data/lib/chemicalml/convention/compchem/constraints/array_rules.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/calculation_requires_finalization.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/compchem_module_must_contain_job_list.rb +2 -1
- data/lib/chemicalml/convention/compchem/constraints/environment_at_most_one_property_list.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/environment_must_not_contain_parameter.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/finalization_at_most_one_molecule.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/finalization_at_most_one_property_list.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/finalization_must_have_content.rb +44 -0
- data/lib/chemicalml/convention/compchem/constraints/finalization_must_not_contain_parameter.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_molecule.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_parameter_list.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/initialization_must_have_content.rb +54 -0
- data/lib/chemicalml/convention/compchem/constraints/initialization_must_not_contain_property.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/job_list_module_must_have_id.rb +1 -0
- data/lib/chemicalml/convention/compchem/constraints/job_module_at_most_one_environment.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/job_module_at_most_one_finalization.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/job_module_must_have_id.rb +1 -0
- data/lib/chemicalml/convention/compchem/constraints/job_must_contain_initialization.rb +1 -0
- data/lib/chemicalml/convention/compchem/constraints/matrix_rules.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints/scalar_units.rb +1 -1
- data/lib/chemicalml/convention/compchem/constraints.rb +4 -0
- data/lib/chemicalml/convention/compchem.rb +4 -2
- data/lib/chemicalml/convention/constraint.rb +40 -9
- data/lib/chemicalml/convention/coordinator.rb +4 -3
- data/lib/chemicalml/convention/detection.rb +10 -4
- data/lib/chemicalml/convention/dictionary/constraints/dictionary_must_have_namespace.rb +1 -0
- data/lib/chemicalml/convention/dictionary/constraints/dictionary_namespace_should_end_with_slash_or_hash.rb +1 -1
- data/lib/chemicalml/convention/dictionary/constraints/entry_id_must_match_pattern.rb +1 -1
- data/lib/chemicalml/convention/dictionary/constraints/entry_ids_unique_within_dictionary.rb +1 -1
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_contain_definition.rb +1 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_id_and_term.rb +1 -1
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_unit_type.rb +1 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_units_co_constraints.rb +1 -1
- data/lib/chemicalml/convention/dictionary/constraints.rb +8 -8
- data/lib/chemicalml/convention/dictionary.rb +2 -2
- data/lib/chemicalml/convention/molecular/constraints/atom_array_must_be_child_of_molecule_or_formula.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_array_must_contain_atoms.rb +15 -6
- data/lib/chemicalml/convention/molecular/constraints/atom_coordinates_must_be_paired.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints/atom_element_type_should_be_in_periodic_table.rb +39 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_id_must_match_pattern.rb +3 -2
- data/lib/chemicalml/convention/molecular/constraints/atom_ids_unique_within_molecule.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_must_have_element_type.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints/atom_must_have_id.rb +2 -1
- data/lib/chemicalml/convention/molecular/constraints/atom_parity_atom_refs4_should_be_distinct.rb +44 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_parity_should_include_parent_atom.rb +65 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_array_must_be_child_of_molecule.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_atom_refs2_should_be_distinct.rb +44 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_id_should_match_pattern.rb +38 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_ids_unique_within_molecule.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_must_have_atom_refs2.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints/bond_must_have_order.rb +2 -1
- data/lib/chemicalml/convention/molecular/constraints/bond_must_reference_atoms_in_same_molecule.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_order_other_must_have_dict_ref.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_order_should_be_in_enum.rb +39 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_order_should_not_be_numeric.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_atom_refs4_should_be_distinct.rb +43 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_cis_trans_must_have_atom_refs4.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_other_must_have_dict_ref.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_should_be_in_enum.rb +38 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_wedge_hash_must_have_atom_refs2.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints/dict_ref_should_resolve.rb +59 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_atom_array_mutually_exclusive_with_children.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_bond_array_mutually_exclusive_with_children.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_chirality_should_be_in_enum.rb +38 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_count_must_not_appear_on_top_level.rb +1 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_id_should_match_pattern.rb +38 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_must_have_id.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints/property_must_have_dict_ref.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints/property_scalar_data_type_matches_dictionary.rb +58 -0
- data/lib/chemicalml/convention/molecular/constraints/references_should_resolve.rb +37 -0
- data/lib/chemicalml/convention/molecular/constraints/scalar_must_have_data_type.rb +1 -1
- data/lib/chemicalml/convention/molecular/constraints.rb +49 -23
- data/lib/chemicalml/convention/molecular.rb +15 -2
- data/lib/chemicalml/convention/registry.rb +79 -11
- data/lib/chemicalml/convention/simple_unit/constraints/root_must_be_unit_list.rb +24 -0
- data/lib/chemicalml/convention/simple_unit/constraints/unit_must_have_power.rb +32 -0
- data/lib/chemicalml/convention/simple_unit/constraints/unit_must_have_symbol.rb +31 -0
- data/lib/chemicalml/convention/simple_unit/constraints.rb +16 -0
- data/lib/chemicalml/convention/simple_unit.rb +37 -0
- data/lib/chemicalml/convention/spectroscopy/constraints/peak_list_must_contain_peaks.rb +31 -0
- data/lib/chemicalml/convention/spectroscopy/constraints/peak_should_have_values.rb +34 -0
- data/lib/chemicalml/convention/spectroscopy/constraints/spectrum_must_have_content.rb +31 -0
- data/lib/chemicalml/convention/spectroscopy/constraints/spectrum_must_have_convention.rb +32 -0
- data/lib/chemicalml/convention/spectroscopy/constraints/spectrum_must_have_format.rb +31 -0
- data/lib/chemicalml/convention/spectroscopy/constraints.rb +20 -0
- data/lib/chemicalml/convention/spectroscopy.rb +41 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_list_must_contain_at_least_one_unit.rb +1 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_list_must_have_namespace.rb +1 -1
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_contain_definition.rb +1 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_id.rb +1 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_multiplier_or_constant_to_si.rb +34 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_parent_si.rb +32 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_symbol_and_unit_type.rb +1 -1
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_title.rb +32 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_parent_si_should_resolve.rb +45 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_unit_type_should_resolve.rb +46 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints.rb +10 -0
- data/lib/chemicalml/convention/unit_dictionary.rb +7 -2
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_id_must_match_pattern.rb +1 -1
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_list_must_contain_at_least_one_unit_type.rb +1 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_list_must_have_namespace.rb +1 -1
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_contain_definition.rb +1 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_have_id_and_name.rb +1 -1
- data/lib/chemicalml/convention/unit_type_dictionary.rb +2 -2
- data/lib/chemicalml/convention/validation_report.rb +30 -3
- data/lib/chemicalml/convention/violation.rb +9 -3
- data/lib/chemicalml/convention.rb +41 -14
- data/lib/chemicalml/dictionary.rb +13 -9
- data/lib/chemicalml/logger.rb +47 -0
- data/lib/chemicalml/schema/definition.rb +2 -2
- data/lib/chemicalml/schema.rb +7 -7
- data/lib/chemicalml/version.rb +1 -1
- data/lib/chemicalml/versioned_parser.rb +10 -10
- data/lib/chemicalml.rb +78 -15
- data/lib/tasks/reference_fetch.rake +30 -31
- data/lib/tasks/scrape_fixtures.rake +23 -24
- metadata +114 -3
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
module Chemicalml
|
|
4
4
|
module Cml
|
|
5
5
|
module Base
|
|
6
|
+
# Container for a list of atoms. Two equivalent serialisations:
|
|
7
|
+
#
|
|
8
|
+
# <atomArray><atom id="a1" elementType="C"/></atomArray>
|
|
9
|
+
#
|
|
10
|
+
# <atomArray atomID="a1 a2" elementType="C O" x3="0.0 1.0"/>
|
|
11
|
+
#
|
|
12
|
+
# The parallel-array form uses the *same* XML attribute names as
|
|
13
|
+
# the singular `<atom>` (e.g. `elementType`, `x3`), NOT names
|
|
14
|
+
# like `elementTypeArray`. The XSD names the attribute *groups*
|
|
15
|
+
# `elementTypeArray` etc., but the wire attribute is `elementType`.
|
|
6
16
|
module AtomArray
|
|
7
17
|
def self.included(klass)
|
|
8
18
|
klass.class_eval do
|
|
9
19
|
include Chemicalml::Cml::Role::AtomArray
|
|
20
|
+
|
|
10
21
|
attribute :atoms, :atom, collection: true
|
|
11
22
|
|
|
12
23
|
attribute :title, :string
|
|
@@ -14,8 +25,13 @@ module Chemicalml
|
|
|
14
25
|
attribute :convention, :string
|
|
15
26
|
attribute :dict_ref, :string
|
|
16
27
|
attribute :ref, :string
|
|
17
|
-
|
|
28
|
+
|
|
29
|
+
# Parallel-array attributes. Wire names match the singular
|
|
30
|
+
# <atom> attributes; the Ruby names use _array suffix for
|
|
31
|
+
# clarity at the call site.
|
|
32
|
+
attribute :atom_id_array, :string
|
|
18
33
|
attribute :count_array, :string
|
|
34
|
+
attribute :element_type_array, :string
|
|
19
35
|
attribute :formal_charge_array, :string
|
|
20
36
|
attribute :hydrogen_count_array, :string
|
|
21
37
|
attribute :occupancy_array, :string
|
|
@@ -27,30 +43,51 @@ module Chemicalml
|
|
|
27
43
|
attribute :x_fract_array, :string
|
|
28
44
|
attribute :y_fract_array, :string
|
|
29
45
|
attribute :z_fract_array, :string
|
|
30
|
-
attribute :atom_i_d_array, :string
|
|
31
46
|
xml do
|
|
32
47
|
namespace Chemicalml::Cml::Namespace
|
|
33
|
-
root
|
|
34
|
-
map_element
|
|
35
|
-
map_attribute
|
|
36
|
-
map_attribute
|
|
37
|
-
map_attribute
|
|
38
|
-
map_attribute
|
|
39
|
-
map_attribute
|
|
40
|
-
map_attribute
|
|
41
|
-
map_attribute
|
|
42
|
-
map_attribute
|
|
43
|
-
map_attribute
|
|
44
|
-
map_attribute
|
|
45
|
-
map_attribute
|
|
46
|
-
map_attribute
|
|
47
|
-
map_attribute
|
|
48
|
-
map_attribute
|
|
49
|
-
map_attribute
|
|
50
|
-
map_attribute
|
|
51
|
-
map_attribute
|
|
52
|
-
map_attribute
|
|
53
|
-
map_attribute
|
|
48
|
+
root 'atomArray'
|
|
49
|
+
map_element 'atom', to: :atoms
|
|
50
|
+
map_attribute 'title', to: :title
|
|
51
|
+
map_attribute 'id', to: :id
|
|
52
|
+
map_attribute 'convention', to: :convention
|
|
53
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
54
|
+
map_attribute 'ref', to: :ref
|
|
55
|
+
map_attribute 'atomID', to: :atom_id_array
|
|
56
|
+
map_attribute 'count', to: :count_array
|
|
57
|
+
map_attribute 'elementType', to: :element_type_array
|
|
58
|
+
map_attribute 'formalCharge', to: :formal_charge_array
|
|
59
|
+
map_attribute 'hydrogenCount', to: :hydrogen_count_array
|
|
60
|
+
map_attribute 'occupancy', to: :occupancy_array
|
|
61
|
+
map_attribute 'x2', to: :x2_array
|
|
62
|
+
map_attribute 'y2', to: :y2_array
|
|
63
|
+
map_attribute 'x3', to: :x3_array
|
|
64
|
+
map_attribute 'y3', to: :y3_array
|
|
65
|
+
map_attribute 'z3', to: :z3_array
|
|
66
|
+
map_attribute 'xFract', to: :x_fract_array
|
|
67
|
+
map_attribute 'yFract', to: :y_fract_array
|
|
68
|
+
map_attribute 'zFract', to: :z_fract_array
|
|
69
|
+
end
|
|
70
|
+
key_value do
|
|
71
|
+
map 'atom', to: :atoms
|
|
72
|
+
map 'title', to: :title
|
|
73
|
+
map 'id', to: :id
|
|
74
|
+
map 'convention', to: :convention
|
|
75
|
+
map 'dictRef', to: :dict_ref
|
|
76
|
+
map 'ref', to: :ref
|
|
77
|
+
map 'atomID', to: :atom_id_array
|
|
78
|
+
map 'count', to: :count_array
|
|
79
|
+
map 'elementType', to: :element_type_array
|
|
80
|
+
map 'formalCharge', to: :formal_charge_array
|
|
81
|
+
map 'hydrogenCount', to: :hydrogen_count_array
|
|
82
|
+
map 'occupancy', to: :occupancy_array
|
|
83
|
+
map 'x2', to: :x2_array
|
|
84
|
+
map 'y2', to: :y2_array
|
|
85
|
+
map 'x3', to: :x3_array
|
|
86
|
+
map 'y3', to: :y3_array
|
|
87
|
+
map 'z3', to: :z3_array
|
|
88
|
+
map 'xFract', to: :x_fract_array
|
|
89
|
+
map 'yFract', to: :y_fract_array
|
|
90
|
+
map 'zFract', to: :z_fract_array
|
|
54
91
|
end
|
|
55
92
|
end
|
|
56
93
|
end
|
|
@@ -7,6 +7,7 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::AtomParity
|
|
10
|
+
|
|
10
11
|
attribute :atom_refs4, :string
|
|
11
12
|
attribute :content, :string
|
|
12
13
|
|
|
@@ -16,13 +17,20 @@ module Chemicalml
|
|
|
16
17
|
attribute :dict_ref, :string
|
|
17
18
|
xml do
|
|
18
19
|
namespace Chemicalml::Cml::Namespace
|
|
19
|
-
root
|
|
20
|
-
map_attribute
|
|
20
|
+
root 'atomParity'
|
|
21
|
+
map_attribute 'atomRefs4', to: :atom_refs4
|
|
21
22
|
map_content to: :content
|
|
22
|
-
map_attribute
|
|
23
|
-
map_attribute
|
|
24
|
-
map_attribute
|
|
25
|
-
map_attribute
|
|
23
|
+
map_attribute 'title', to: :title
|
|
24
|
+
map_attribute 'id', to: :id
|
|
25
|
+
map_attribute 'convention', to: :convention
|
|
26
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
27
|
+
end
|
|
28
|
+
key_value do
|
|
29
|
+
map 'atomRefs4', to: :atom_refs4
|
|
30
|
+
map 'title', to: :title
|
|
31
|
+
map 'id', to: :id
|
|
32
|
+
map 'convention', to: :convention
|
|
33
|
+
map 'dictRef', to: :dict_ref
|
|
26
34
|
end
|
|
27
35
|
end
|
|
28
36
|
end
|
|
@@ -7,6 +7,7 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::AtomSet
|
|
10
|
+
|
|
10
11
|
attribute :id, :string
|
|
11
12
|
attribute :title, :string
|
|
12
13
|
attribute :dict_ref, :string
|
|
@@ -15,12 +16,19 @@ module Chemicalml
|
|
|
15
16
|
attribute :size, :string
|
|
16
17
|
xml do
|
|
17
18
|
namespace Chemicalml::Cml::Namespace
|
|
18
|
-
root
|
|
19
|
-
map_attribute
|
|
20
|
-
map_attribute
|
|
21
|
-
map_attribute
|
|
22
|
-
map_attribute
|
|
23
|
-
map_attribute
|
|
19
|
+
root 'atomSet'
|
|
20
|
+
map_attribute 'id', to: :id
|
|
21
|
+
map_attribute 'title', to: :title
|
|
22
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
23
|
+
map_attribute 'convention', to: :convention
|
|
24
|
+
map_attribute 'size', to: :size
|
|
25
|
+
end
|
|
26
|
+
key_value do
|
|
27
|
+
map 'id', to: :id
|
|
28
|
+
map 'title', to: :title
|
|
29
|
+
map 'dictRef', to: :dict_ref
|
|
30
|
+
map 'convention', to: :convention
|
|
31
|
+
map 'size', to: :size
|
|
24
32
|
end
|
|
25
33
|
end
|
|
26
34
|
end
|
|
@@ -7,6 +7,8 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::AtomType
|
|
10
|
+
include Chemicalml::Cml::Base::CommonChildren
|
|
11
|
+
|
|
10
12
|
attribute :id, :string
|
|
11
13
|
attribute :title, :string
|
|
12
14
|
attribute :dict_ref, :string
|
|
@@ -18,15 +20,29 @@ module Chemicalml
|
|
|
18
20
|
attribute :atom_ref, :string
|
|
19
21
|
xml do
|
|
20
22
|
namespace Chemicalml::Cml::Namespace
|
|
21
|
-
root
|
|
22
|
-
map_attribute
|
|
23
|
-
map_attribute
|
|
24
|
-
map_attribute
|
|
25
|
-
map_attribute
|
|
26
|
-
map_attribute
|
|
27
|
-
map_attribute
|
|
28
|
-
map_attribute
|
|
29
|
-
map_attribute
|
|
23
|
+
root 'atomType'
|
|
24
|
+
map_attribute 'id', to: :id
|
|
25
|
+
map_attribute 'title', to: :title
|
|
26
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
27
|
+
map_attribute 'convention', to: :convention
|
|
28
|
+
map_attribute 'elementType', to: :elementType
|
|
29
|
+
map_attribute 'ref', to: :ref
|
|
30
|
+
map_attribute 'name', to: :name
|
|
31
|
+
map_attribute 'atomRef', to: :atom_ref
|
|
32
|
+
end
|
|
33
|
+
key_value do
|
|
34
|
+
map 'metadataList', to: :metadata_lists
|
|
35
|
+
map 'label', to: :labels
|
|
36
|
+
map 'name', to: :names
|
|
37
|
+
map 'description', to: :descriptions
|
|
38
|
+
map 'id', to: :id
|
|
39
|
+
map 'title', to: :title
|
|
40
|
+
map 'dictRef', to: :dict_ref
|
|
41
|
+
map 'convention', to: :convention
|
|
42
|
+
map 'elementType', to: :elementType
|
|
43
|
+
map 'ref', to: :ref
|
|
44
|
+
map 'name', to: :name
|
|
45
|
+
map 'atomRef', to: :atom_ref
|
|
30
46
|
end
|
|
31
47
|
end
|
|
32
48
|
end
|
|
@@ -7,23 +7,37 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::AtomTypeList
|
|
10
|
+
include Chemicalml::Cml::Base::CommonChildren
|
|
11
|
+
|
|
10
12
|
attribute :id, :string
|
|
11
13
|
attribute :title, :string
|
|
12
14
|
attribute :dict_ref, :string
|
|
13
15
|
attribute :convention, :string
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
attribute :atom_types, :atomType, collection: true
|
|
16
18
|
|
|
17
19
|
attribute :ref, :string
|
|
18
20
|
xml do
|
|
19
21
|
namespace Chemicalml::Cml::Namespace
|
|
20
|
-
map_element
|
|
21
|
-
root
|
|
22
|
-
map_attribute
|
|
23
|
-
map_attribute
|
|
24
|
-
map_attribute
|
|
25
|
-
map_attribute
|
|
26
|
-
map_attribute
|
|
22
|
+
map_element 'atomType', to: :atom_types
|
|
23
|
+
root 'atomTypeList'
|
|
24
|
+
map_attribute 'id', to: :id
|
|
25
|
+
map_attribute 'title', to: :title
|
|
26
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
27
|
+
map_attribute 'convention', to: :convention
|
|
28
|
+
map_attribute 'ref', to: :ref
|
|
29
|
+
end
|
|
30
|
+
key_value do
|
|
31
|
+
map 'metadataList', to: :metadata_lists
|
|
32
|
+
map 'label', to: :labels
|
|
33
|
+
map 'name', to: :names
|
|
34
|
+
map 'description', to: :descriptions
|
|
35
|
+
map 'atomType', to: :atom_types
|
|
36
|
+
map 'id', to: :id
|
|
37
|
+
map 'title', to: :title
|
|
38
|
+
map 'dictRef', to: :dict_ref
|
|
39
|
+
map 'convention', to: :convention
|
|
40
|
+
map 'ref', to: :ref
|
|
27
41
|
end
|
|
28
42
|
end
|
|
29
43
|
end
|
|
@@ -7,6 +7,8 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::AtomicBasisFunction
|
|
10
|
+
include Chemicalml::Cml::Base::CommonChildren
|
|
11
|
+
|
|
10
12
|
attribute :id, :string
|
|
11
13
|
attribute :title, :string
|
|
12
14
|
attribute :dict_ref, :string
|
|
@@ -22,19 +24,37 @@ module Chemicalml
|
|
|
22
24
|
attribute :lm, :string
|
|
23
25
|
xml do
|
|
24
26
|
namespace Chemicalml::Cml::Namespace
|
|
25
|
-
root
|
|
26
|
-
map_attribute
|
|
27
|
-
map_attribute
|
|
28
|
-
map_attribute
|
|
29
|
-
map_attribute
|
|
30
|
-
map_attribute
|
|
31
|
-
map_attribute
|
|
32
|
-
map_attribute
|
|
33
|
-
map_attribute
|
|
34
|
-
map_attribute
|
|
35
|
-
map_attribute
|
|
36
|
-
map_attribute
|
|
37
|
-
map_attribute
|
|
27
|
+
root 'atomicBasisFunction'
|
|
28
|
+
map_attribute 'id', to: :id
|
|
29
|
+
map_attribute 'title', to: :title
|
|
30
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
31
|
+
map_attribute 'convention', to: :convention
|
|
32
|
+
map_attribute 'atomRef', to: :atomRef
|
|
33
|
+
map_attribute 'n', to: :n
|
|
34
|
+
map_attribute 'l', to: :l
|
|
35
|
+
map_attribute 'm', to: :m
|
|
36
|
+
map_attribute 'ms', to: :ms
|
|
37
|
+
map_attribute 'type', to: :type
|
|
38
|
+
map_attribute 'symbol', to: :symbol
|
|
39
|
+
map_attribute 'lm', to: :lm
|
|
40
|
+
end
|
|
41
|
+
key_value do
|
|
42
|
+
map 'metadataList', to: :metadata_lists
|
|
43
|
+
map 'label', to: :labels
|
|
44
|
+
map 'name', to: :names
|
|
45
|
+
map 'description', to: :descriptions
|
|
46
|
+
map 'id', to: :id
|
|
47
|
+
map 'title', to: :title
|
|
48
|
+
map 'dictRef', to: :dict_ref
|
|
49
|
+
map 'convention', to: :convention
|
|
50
|
+
map 'atomRef', to: :atomRef
|
|
51
|
+
map 'n', to: :n
|
|
52
|
+
map 'l', to: :l
|
|
53
|
+
map 'm', to: :m
|
|
54
|
+
map 'ms', to: :ms
|
|
55
|
+
map 'type', to: :type
|
|
56
|
+
map 'symbol', to: :symbol
|
|
57
|
+
map 'lm', to: :lm
|
|
38
58
|
end
|
|
39
59
|
end
|
|
40
60
|
end
|
|
@@ -7,24 +7,37 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::Band
|
|
10
|
+
|
|
10
11
|
attribute :id, :string
|
|
11
12
|
attribute :title, :string
|
|
12
13
|
attribute :dict_ref, :string
|
|
13
14
|
attribute :convention, :string
|
|
14
15
|
attribute :kpointRef, :string
|
|
16
|
+
attribute :kpoint, :string
|
|
15
17
|
attribute :weight, :string
|
|
16
18
|
|
|
17
19
|
attribute :label, :string
|
|
18
20
|
xml do
|
|
19
21
|
namespace Chemicalml::Cml::Namespace
|
|
20
|
-
root
|
|
21
|
-
map_attribute
|
|
22
|
-
map_attribute
|
|
23
|
-
map_attribute
|
|
24
|
-
map_attribute
|
|
25
|
-
map_attribute
|
|
26
|
-
map_attribute
|
|
27
|
-
map_attribute
|
|
22
|
+
root 'band'
|
|
23
|
+
map_attribute 'id', to: :id
|
|
24
|
+
map_attribute 'title', to: :title
|
|
25
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
26
|
+
map_attribute 'convention', to: :convention
|
|
27
|
+
map_attribute 'kpointRef', to: :kpointRef
|
|
28
|
+
map_attribute 'kpoint', to: :kpoint
|
|
29
|
+
map_attribute 'weight', to: :weight
|
|
30
|
+
map_attribute 'label', to: :label
|
|
31
|
+
end
|
|
32
|
+
key_value do
|
|
33
|
+
map 'id', to: :id
|
|
34
|
+
map 'title', to: :title
|
|
35
|
+
map 'dictRef', to: :dict_ref
|
|
36
|
+
map 'convention', to: :convention
|
|
37
|
+
map 'kpointRef', to: :kpointRef
|
|
38
|
+
map 'kpoint', to: :kpoint
|
|
39
|
+
map 'weight', to: :weight
|
|
40
|
+
map 'label', to: :label
|
|
28
41
|
end
|
|
29
42
|
end
|
|
30
43
|
end
|
|
@@ -7,21 +7,29 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::BandList
|
|
10
|
+
|
|
10
11
|
attribute :id, :string
|
|
11
12
|
attribute :title, :string
|
|
12
13
|
attribute :dict_ref, :string
|
|
13
14
|
attribute :convention, :string
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
attribute :bands, :band, collection: true
|
|
16
17
|
|
|
17
18
|
xml do
|
|
18
19
|
namespace Chemicalml::Cml::Namespace
|
|
19
|
-
map_element
|
|
20
|
-
root
|
|
21
|
-
map_attribute
|
|
22
|
-
map_attribute
|
|
23
|
-
map_attribute
|
|
24
|
-
map_attribute
|
|
20
|
+
map_element 'band', to: :bands
|
|
21
|
+
root 'bandList'
|
|
22
|
+
map_attribute 'id', to: :id
|
|
23
|
+
map_attribute 'title', to: :title
|
|
24
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
25
|
+
map_attribute 'convention', to: :convention
|
|
26
|
+
end
|
|
27
|
+
key_value do
|
|
28
|
+
map 'band', to: :bands
|
|
29
|
+
map 'id', to: :id
|
|
30
|
+
map 'title', to: :title
|
|
31
|
+
map 'dictRef', to: :dict_ref
|
|
32
|
+
map 'convention', to: :convention
|
|
25
33
|
end
|
|
26
34
|
end
|
|
27
35
|
end
|
|
@@ -7,25 +7,40 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::BasisSet
|
|
10
|
+
include Chemicalml::Cml::Base::CommonChildren
|
|
11
|
+
|
|
10
12
|
attribute :id, :string
|
|
11
13
|
attribute :title, :string
|
|
12
14
|
attribute :dict_ref, :string
|
|
13
15
|
attribute :convention, :string
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
attribute :atomic_basis_functions, :atomicBasisFunction, collection: true
|
|
16
18
|
|
|
17
19
|
attribute :ref, :string
|
|
18
20
|
attribute :role, :string
|
|
19
21
|
xml do
|
|
20
22
|
namespace Chemicalml::Cml::Namespace
|
|
21
|
-
map_element
|
|
22
|
-
root
|
|
23
|
-
map_attribute
|
|
24
|
-
map_attribute
|
|
25
|
-
map_attribute
|
|
26
|
-
map_attribute
|
|
27
|
-
map_attribute
|
|
28
|
-
map_attribute
|
|
23
|
+
map_element 'atomicBasisFunction', to: :atomic_basis_functions
|
|
24
|
+
root 'basisSet'
|
|
25
|
+
map_attribute 'id', to: :id
|
|
26
|
+
map_attribute 'title', to: :title
|
|
27
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
28
|
+
map_attribute 'convention', to: :convention
|
|
29
|
+
map_attribute 'ref', to: :ref
|
|
30
|
+
map_attribute 'role', to: :role
|
|
31
|
+
end
|
|
32
|
+
key_value do
|
|
33
|
+
map 'metadataList', to: :metadata_lists
|
|
34
|
+
map 'label', to: :labels
|
|
35
|
+
map 'name', to: :names
|
|
36
|
+
map 'description', to: :descriptions
|
|
37
|
+
map 'atomicBasisFunction', to: :atomic_basis_functions
|
|
38
|
+
map 'id', to: :id
|
|
39
|
+
map 'title', to: :title
|
|
40
|
+
map 'dictRef', to: :dict_ref
|
|
41
|
+
map 'convention', to: :convention
|
|
42
|
+
map 'ref', to: :ref
|
|
43
|
+
map 'role', to: :role
|
|
29
44
|
end
|
|
30
45
|
end
|
|
31
46
|
end
|
|
@@ -7,28 +7,54 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::Bond
|
|
10
|
+
include Chemicalml::Cml::Base::CommonChildren
|
|
11
|
+
|
|
10
12
|
attribute :id, :string
|
|
11
13
|
attribute :atom_refs2, :string
|
|
14
|
+
attribute :atom_refs, :string
|
|
12
15
|
attribute :order, :string
|
|
13
16
|
attribute :title, :string
|
|
14
17
|
attribute :dict_ref, :string
|
|
15
18
|
attribute :bond_stereo, :bondStereo
|
|
19
|
+
attribute :bond_type, :bondType
|
|
20
|
+
attribute :electrons, :electron, collection: true
|
|
16
21
|
|
|
17
22
|
attribute :convention, :string
|
|
18
23
|
attribute :ref, :string
|
|
19
24
|
attribute :bond_refs, :string
|
|
20
25
|
xml do
|
|
21
26
|
namespace Chemicalml::Cml::Namespace
|
|
22
|
-
root
|
|
23
|
-
map_attribute
|
|
24
|
-
map_attribute
|
|
25
|
-
map_attribute
|
|
26
|
-
map_attribute
|
|
27
|
-
map_attribute
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
root 'bond'
|
|
28
|
+
map_attribute 'id', to: :id
|
|
29
|
+
map_attribute 'atomRefs2', to: :atom_refs2
|
|
30
|
+
map_attribute 'atomRefs', to: :atom_refs
|
|
31
|
+
map_attribute 'order', to: :order
|
|
32
|
+
map_attribute 'title', to: :title
|
|
33
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
34
|
+
map_element 'bondStereo', to: :bond_stereo
|
|
35
|
+
map_element 'bondType', to: :bond_type
|
|
36
|
+
map_element 'electron', to: :electrons
|
|
37
|
+
map_attribute 'convention', to: :convention
|
|
38
|
+
map_attribute 'ref', to: :ref
|
|
39
|
+
map_attribute 'bondRefs', to: :bond_refs
|
|
40
|
+
end
|
|
41
|
+
key_value do
|
|
42
|
+
map 'metadataList', to: :metadata_lists
|
|
43
|
+
map 'label', to: :labels
|
|
44
|
+
map 'name', to: :names
|
|
45
|
+
map 'description', to: :descriptions
|
|
46
|
+
map 'bondStereo', to: :bond_stereo
|
|
47
|
+
map 'bondType', to: :bond_type
|
|
48
|
+
map 'electron', to: :electrons
|
|
49
|
+
map 'id', to: :id
|
|
50
|
+
map 'atomRefs2', to: :atom_refs2
|
|
51
|
+
map 'atomRefs', to: :atom_refs
|
|
52
|
+
map 'order', to: :order
|
|
53
|
+
map 'title', to: :title
|
|
54
|
+
map 'dictRef', to: :dict_ref
|
|
55
|
+
map 'convention', to: :convention
|
|
56
|
+
map 'ref', to: :ref
|
|
57
|
+
map 'bondRefs', to: :bond_refs
|
|
32
58
|
end
|
|
33
59
|
end
|
|
34
60
|
end
|
|
@@ -3,32 +3,55 @@
|
|
|
3
3
|
module Chemicalml
|
|
4
4
|
module Cml
|
|
5
5
|
module Base
|
|
6
|
+
# Container for a list of bonds. Two equivalent serialisations:
|
|
7
|
+
#
|
|
8
|
+
# <bondArray><bond atomRefs2="a1 a2" order="1"/></bondArray>
|
|
9
|
+
#
|
|
10
|
+
# <bondArray atomRef1="a1 a2" atomRef2="a2 a3" order="1 2"/>
|
|
11
|
+
#
|
|
12
|
+
# The parallel-array form uses the wire attribute names
|
|
13
|
+
# `atomRef1`, `atomRef2`, `bondID`, `order` — the XSD attribute
|
|
14
|
+
# *group* is named `atomRef1Array` etc., but the wire attribute
|
|
15
|
+
# is `atomRef1`.
|
|
6
16
|
module BondArray
|
|
7
17
|
def self.included(klass)
|
|
8
18
|
klass.class_eval do
|
|
9
19
|
include Chemicalml::Cml::Role::BondArray
|
|
20
|
+
|
|
10
21
|
attribute :bonds, :bond, collection: true
|
|
11
22
|
|
|
12
23
|
attribute :title, :string
|
|
13
24
|
attribute :id, :string
|
|
14
25
|
attribute :convention, :string
|
|
15
26
|
attribute :dict_ref, :string
|
|
16
|
-
|
|
27
|
+
|
|
28
|
+
attribute :bond_id_array, :string
|
|
17
29
|
attribute :atom_ref1_array, :string
|
|
18
30
|
attribute :atom_ref2_array, :string
|
|
19
31
|
attribute :order_array, :string
|
|
20
32
|
xml do
|
|
21
33
|
namespace Chemicalml::Cml::Namespace
|
|
22
|
-
root
|
|
23
|
-
map_element
|
|
24
|
-
map_attribute
|
|
25
|
-
map_attribute
|
|
26
|
-
map_attribute
|
|
27
|
-
map_attribute
|
|
28
|
-
map_attribute
|
|
29
|
-
map_attribute
|
|
30
|
-
map_attribute
|
|
31
|
-
map_attribute
|
|
34
|
+
root 'bondArray'
|
|
35
|
+
map_element 'bond', to: :bonds
|
|
36
|
+
map_attribute 'title', to: :title
|
|
37
|
+
map_attribute 'id', to: :id
|
|
38
|
+
map_attribute 'convention', to: :convention
|
|
39
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
40
|
+
map_attribute 'bondID', to: :bond_id_array
|
|
41
|
+
map_attribute 'atomRef1', to: :atom_ref1_array
|
|
42
|
+
map_attribute 'atomRef2', to: :atom_ref2_array
|
|
43
|
+
map_attribute 'order', to: :order_array
|
|
44
|
+
end
|
|
45
|
+
key_value do
|
|
46
|
+
map 'bond', to: :bonds
|
|
47
|
+
map 'title', to: :title
|
|
48
|
+
map 'id', to: :id
|
|
49
|
+
map 'convention', to: :convention
|
|
50
|
+
map 'dictRef', to: :dict_ref
|
|
51
|
+
map 'bondID', to: :bond_id_array
|
|
52
|
+
map 'atomRef1', to: :atom_ref1_array
|
|
53
|
+
map 'atomRef2', to: :atom_ref2_array
|
|
54
|
+
map 'order', to: :order_array
|
|
32
55
|
end
|
|
33
56
|
end
|
|
34
57
|
end
|
|
@@ -7,6 +7,7 @@ module Chemicalml
|
|
|
7
7
|
def self.included(klass)
|
|
8
8
|
klass.class_eval do
|
|
9
9
|
include Chemicalml::Cml::Role::BondSet
|
|
10
|
+
|
|
10
11
|
attribute :id, :string
|
|
11
12
|
attribute :title, :string
|
|
12
13
|
attribute :dict_ref, :string
|
|
@@ -15,12 +16,19 @@ module Chemicalml
|
|
|
15
16
|
attribute :size, :string
|
|
16
17
|
xml do
|
|
17
18
|
namespace Chemicalml::Cml::Namespace
|
|
18
|
-
root
|
|
19
|
-
map_attribute
|
|
20
|
-
map_attribute
|
|
21
|
-
map_attribute
|
|
22
|
-
map_attribute
|
|
23
|
-
map_attribute
|
|
19
|
+
root 'bondSet'
|
|
20
|
+
map_attribute 'id', to: :id
|
|
21
|
+
map_attribute 'title', to: :title
|
|
22
|
+
map_attribute 'dictRef', to: :dict_ref
|
|
23
|
+
map_attribute 'convention', to: :convention
|
|
24
|
+
map_attribute 'size', to: :size
|
|
25
|
+
end
|
|
26
|
+
key_value do
|
|
27
|
+
map 'id', to: :id
|
|
28
|
+
map 'title', to: :title
|
|
29
|
+
map 'dictRef', to: :dict_ref
|
|
30
|
+
map 'convention', to: :convention
|
|
31
|
+
map 'size', to: :size
|
|
24
32
|
end
|
|
25
33
|
end
|
|
26
34
|
end
|