chemicalml 0.2.0 → 0.2.1
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/.github/workflows/release.yml +7 -1
- data/CLAUDE.md +48 -41
- data/TODO.align/36-molecular-convention-coverage.md +46 -0
- data/TODO.align/37-compchem-convention-coverage.md +55 -0
- data/TODO.align/38-dictionary-convention-coverage.md +34 -0
- data/TODO.align/39-unit-dictionary-convention-coverage.md +33 -0
- data/TODO.align/40-unit-type-dictionary-convention-coverage.md +28 -0
- data/TODO.align/41-expand-canonical-model-layer.md +43 -0
- data/TODO.align/42-translator-wire-new-models.md +31 -0
- data/TODO.align/43-dictionary-model-no-to-h.md +39 -0
- data/TODO.align/44-schema3-only-and-schema24-module.md +44 -0
- data/TODO.align/45-documentation-and-final-verification.md +23 -0
- data/TODO.align/46-lattice-vector-content.md +24 -0
- data/TODO.align/47-molecule-crystal-spectra-property-lists.md +23 -0
- data/TODO.align/48-model-list-and-module-lists.md +21 -0
- data/TODO.align/49-more-chemistry-models.md +34 -0
- data/TODO.align/50-validation-report.md +29 -0
- data/TODO.align/51-convention-auto-detection.md +30 -0
- data/TODO.align/52-schema24-legacy-elements.md +28 -0
- data/TODO.align/53-round-trip-integration-specs.md +30 -0
- data/TODO.align/54-document-versioned-parser-shim.md +38 -0
- data/TODO.align/55-molecule-missing-attributes.md +20 -0
- data/TODO.align/56-geometry-models.md +24 -0
- data/TODO.align/57-compchem-models.md +26 -0
- data/TODO.align/58-remaining-models.md +24 -0
- data/TODO.align/59-wire-new-models-translator.md +18 -0
- data/TODO.align/60-docs-and-final-verification.md +19 -0
- data/lib/chemicalml/cml/base/abundance.rb +6 -0
- data/lib/chemicalml/cml/base/action.rb +20 -0
- data/lib/chemicalml/cml/base/action_list.rb +18 -0
- data/lib/chemicalml/cml/base/alternative.rb +28 -0
- data/lib/chemicalml/cml/base/amount.rb +2 -0
- data/lib/chemicalml/cml/base/angle.rb +12 -0
- data/lib/chemicalml/cml/base/annotation.rb +30 -0
- data/lib/chemicalml/cml/base/appinfo.rb +32 -0
- data/lib/chemicalml/cml/base/arg.rb +46 -0
- data/lib/chemicalml/cml/base/array.rb +22 -0
- data/lib/chemicalml/cml/base/array_list.rb +2 -0
- data/lib/chemicalml/cml/base/atom.rb +18 -0
- data/lib/chemicalml/cml/base/atom_array.rb +38 -0
- data/lib/chemicalml/cml/base/atom_parity.rb +8 -0
- data/lib/chemicalml/cml/base/atom_set.rb +2 -0
- data/lib/chemicalml/cml/base/atom_type.rb +4 -0
- data/lib/chemicalml/cml/base/atom_type_list.rb +2 -0
- data/lib/chemicalml/cml/base/atomic_basis_function.rb +4 -0
- data/lib/chemicalml/cml/base/band.rb +2 -0
- data/lib/chemicalml/cml/base/basis_set.rb +4 -0
- data/lib/chemicalml/cml/base/bond.rb +6 -0
- data/lib/chemicalml/cml/base/bond_array.rb +16 -0
- data/lib/chemicalml/cml/base/bond_set.rb +2 -0
- data/lib/chemicalml/cml/base/bond_stereo.rb +10 -0
- data/lib/chemicalml/cml/base/bond_type.rb +2 -0
- data/lib/chemicalml/cml/base/bond_type_list.rb +2 -0
- data/lib/chemicalml/cml/base/cell_parameter.rb +4 -0
- data/lib/chemicalml/cml/base/complex_object.rb +30 -0
- data/lib/chemicalml/cml/base/condition_list.rb +4 -0
- data/lib/chemicalml/cml/base/crystal.rb +2 -0
- data/lib/chemicalml/cml/base/description.rb +2 -0
- data/lib/chemicalml/cml/base/dictionary.rb +6 -0
- data/lib/chemicalml/cml/base/dimension.rb +10 -0
- data/lib/chemicalml/cml/base/eigen.rb +2 -0
- data/lib/chemicalml/cml/base/electron.rb +6 -0
- data/lib/chemicalml/cml/base/enumeration.rb +32 -0
- data/lib/chemicalml/cml/base/expression.rb +32 -0
- data/lib/chemicalml/cml/base/float.rb +40 -0
- data/lib/chemicalml/cml/base/float_array.rb +42 -0
- data/lib/chemicalml/cml/base/fragment.rb +6 -0
- data/lib/chemicalml/cml/base/fragment_list.rb +4 -0
- data/lib/chemicalml/cml/base/identifier.rb +8 -0
- data/lib/chemicalml/cml/base/integer.rb +40 -0
- data/lib/chemicalml/cml/base/integer_array.rb +42 -0
- data/lib/chemicalml/cml/base/isotope.rb +2 -0
- data/lib/chemicalml/cml/base/isotope_list.rb +2 -0
- data/lib/chemicalml/cml/base/join.rb +6 -0
- data/lib/chemicalml/cml/base/kpoint.rb +2 -0
- data/lib/chemicalml/cml/base/label.rb +2 -0
- data/lib/chemicalml/cml/base/lattice.rb +2 -0
- data/lib/chemicalml/cml/base/lattice_vector.rb +2 -0
- data/lib/chemicalml/cml/base/length.rb +10 -0
- data/lib/chemicalml/cml/base/line3.rb +6 -0
- data/lib/chemicalml/cml/base/link.rb +20 -0
- data/lib/chemicalml/cml/base/list.rb +2 -0
- data/lib/chemicalml/cml/base/map.rb +12 -0
- data/lib/chemicalml/cml/base/matrix.rb +12 -0
- data/lib/chemicalml/cml/base/metadata.rb +4 -0
- data/lib/chemicalml/cml/base/metadata_list.rb +6 -0
- data/lib/chemicalml/cml/base/molecule.rb +10 -0
- data/lib/chemicalml/cml/base/molecule_list.rb +2 -0
- data/lib/chemicalml/cml/base/name.rb +2 -0
- data/lib/chemicalml/cml/base/object.rb +4 -0
- data/lib/chemicalml/cml/base/observation.rb +4 -0
- data/lib/chemicalml/cml/base/operator.rb +32 -0
- data/lib/chemicalml/cml/base/parameter.rb +10 -0
- data/lib/chemicalml/cml/base/parameter_list.rb +6 -0
- data/lib/chemicalml/cml/base/particle.rb +6 -0
- data/lib/chemicalml/cml/base/peak.rb +30 -0
- data/lib/chemicalml/cml/base/peak_group.rb +38 -0
- data/lib/chemicalml/cml/base/peak_list.rb +2 -0
- data/lib/chemicalml/cml/base/peak_structure.rb +14 -0
- data/lib/chemicalml/cml/base/plane3.rb +2 -0
- data/lib/chemicalml/cml/base/point3.rb +2 -0
- data/lib/chemicalml/cml/base/potential_form.rb +2 -0
- data/lib/chemicalml/cml/base/product.rb +16 -0
- data/lib/chemicalml/cml/base/product_list.rb +14 -0
- data/lib/chemicalml/cml/base/property.rb +6 -0
- data/lib/chemicalml/cml/base/property_list.rb +6 -0
- data/lib/chemicalml/cml/base/reactant.rb +16 -0
- data/lib/chemicalml/cml/base/reactant_list.rb +14 -0
- data/lib/chemicalml/cml/base/reaction.rb +16 -0
- data/lib/chemicalml/cml/base/reaction_list.rb +12 -0
- data/lib/chemicalml/cml/base/reaction_scheme.rb +10 -0
- data/lib/chemicalml/cml/base/reaction_step.rb +6 -0
- data/lib/chemicalml/cml/base/reaction_step_list.rb +8 -0
- data/lib/chemicalml/cml/base/region.rb +8 -0
- data/lib/chemicalml/cml/base/related_entry.rb +26 -0
- data/lib/chemicalml/cml/base/sample.rb +4 -0
- data/lib/chemicalml/cml/base/scalar.rb +18 -0
- data/lib/chemicalml/cml/base/spectator.rb +2 -0
- data/lib/chemicalml/cml/base/spectrum.rb +12 -0
- data/lib/chemicalml/cml/base/spectrum_data.rb +2 -0
- data/lib/chemicalml/cml/base/spectrum_list.rb +4 -0
- data/lib/chemicalml/cml/base/sphere3.rb +2 -0
- data/lib/chemicalml/cml/base/string.rb +32 -0
- data/lib/chemicalml/cml/base/string_array.rb +40 -0
- data/lib/chemicalml/cml/base/substance.rb +12 -0
- data/lib/chemicalml/cml/base/substance_list.rb +6 -0
- data/lib/chemicalml/cml/base/symmetry.rb +4 -0
- data/lib/chemicalml/cml/base/system.rb +4 -0
- data/lib/chemicalml/cml/base/table.rb +10 -0
- data/lib/chemicalml/cml/base/table_content.rb +2 -0
- data/lib/chemicalml/cml/base/table_header_cell.rb +10 -0
- data/lib/chemicalml/cml/base/tcell.rb +34 -0
- data/lib/chemicalml/cml/base/torsion.rb +12 -0
- data/lib/chemicalml/cml/base/trow.rb +32 -0
- data/lib/chemicalml/cml/base/unit.rb +12 -0
- data/lib/chemicalml/cml/base/unit_list.rb +12 -0
- data/lib/chemicalml/cml/base/unit_type.rb +10 -0
- data/lib/chemicalml/cml/base/unit_type_list.rb +10 -0
- data/lib/chemicalml/cml/base/vector3.rb +2 -0
- data/lib/chemicalml/cml/base/xaxis.rb +6 -0
- data/lib/chemicalml/cml/base/yaxis.rb +6 -0
- data/lib/chemicalml/cml/base.rb +17 -0
- data/lib/chemicalml/cml/elements.rb +39 -4
- data/lib/chemicalml/cml/role/alternative.rb +10 -0
- data/lib/chemicalml/cml/role/annotation.rb +10 -0
- data/lib/chemicalml/cml/role/appinfo.rb +10 -0
- data/lib/chemicalml/cml/role/arg.rb +10 -0
- data/lib/chemicalml/cml/role/cml_module.rb +2 -3
- data/lib/chemicalml/cml/role/complex_object.rb +10 -0
- data/lib/chemicalml/cml/role/enumeration.rb +10 -0
- data/lib/chemicalml/cml/role/expression.rb +10 -0
- data/lib/chemicalml/cml/role/float.rb +10 -0
- data/lib/chemicalml/cml/role/float_array.rb +10 -0
- data/lib/chemicalml/cml/role/integer.rb +10 -0
- data/lib/chemicalml/cml/role/integer_array.rb +10 -0
- data/lib/chemicalml/cml/role/operator.rb +10 -0
- data/lib/chemicalml/cml/role/related_entry.rb +10 -0
- data/lib/chemicalml/cml/role/string.rb +10 -0
- data/lib/chemicalml/cml/role/string_array.rb +10 -0
- data/lib/chemicalml/cml/role/tcell.rb +10 -0
- data/lib/chemicalml/cml/role/trow.rb +10 -0
- data/lib/chemicalml/cml/role.rb +17 -0
- data/lib/chemicalml/cml/schema24/alternative.rb +14 -0
- data/lib/chemicalml/cml/schema24/annotation.rb +15 -0
- data/lib/chemicalml/cml/schema24/appinfo.rb +15 -0
- data/lib/chemicalml/cml/schema24/arg.rb +14 -0
- data/lib/chemicalml/cml/schema24/cml_module.rb +18 -0
- data/lib/chemicalml/cml/schema24/complex_object.rb +14 -0
- data/lib/chemicalml/cml/schema24/configuration.rb +5 -2
- data/lib/chemicalml/cml/schema24/enumeration.rb +16 -0
- data/lib/chemicalml/cml/schema24/expression.rb +14 -0
- data/lib/chemicalml/cml/schema24/float.rb +14 -0
- data/lib/chemicalml/cml/schema24/float_array.rb +14 -0
- data/lib/chemicalml/cml/schema24/integer.rb +14 -0
- data/lib/chemicalml/cml/schema24/integer_array.rb +14 -0
- data/lib/chemicalml/cml/schema24/operator.rb +14 -0
- data/lib/chemicalml/cml/schema24/related_entry.rb +14 -0
- data/lib/chemicalml/cml/schema24/string.rb +14 -0
- data/lib/chemicalml/cml/schema24/string_array.rb +14 -0
- data/lib/chemicalml/cml/schema24/tcell.rb +14 -0
- data/lib/chemicalml/cml/schema24/trow.rb +14 -0
- data/lib/chemicalml/cml/schema24.rb +33 -5
- data/lib/chemicalml/cml.rb +1 -3
- data/lib/chemicalml/context_configuration.rb +8 -2
- data/lib/chemicalml/convention/base.rb +17 -3
- data/lib/chemicalml/convention/compchem/constraints/array_rules.rb +44 -0
- data/lib/chemicalml/convention/compchem/constraints/calculation_requires_finalization.rb +28 -0
- data/lib/chemicalml/convention/compchem/constraints/compchem_module_must_contain_job_list.rb +4 -4
- data/lib/chemicalml/convention/compchem/constraints/environment_at_most_one_property_list.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/environment_must_not_contain_parameter.rb +28 -0
- data/lib/chemicalml/convention/compchem/constraints/finalization_at_most_one_molecule.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/finalization_at_most_one_property_list.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/finalization_must_not_contain_parameter.rb +27 -0
- data/lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_molecule.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_parameter_list.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/initialization_must_not_contain_property.rb +28 -0
- data/lib/chemicalml/convention/compchem/constraints/job_list_module_must_have_id.rb +24 -0
- data/lib/chemicalml/convention/compchem/constraints/job_module_at_most_one_environment.rb +25 -0
- data/lib/chemicalml/convention/compchem/constraints/job_module_at_most_one_finalization.rb +25 -0
- data/lib/chemicalml/convention/compchem/constraints/job_module_must_have_id.rb +24 -0
- data/lib/chemicalml/convention/compchem/constraints/job_must_contain_initialization.rb +6 -9
- data/lib/chemicalml/convention/compchem/constraints/matrix_rules.rb +48 -0
- data/lib/chemicalml/convention/compchem/constraints/module_predicates.rb +50 -0
- data/lib/chemicalml/convention/compchem/constraints/scalar_units.rb +42 -0
- data/lib/chemicalml/convention/compchem/constraints.rb +36 -2
- data/lib/chemicalml/convention/compchem.rb +16 -0
- data/lib/chemicalml/convention/constraint.rb +31 -18
- data/lib/chemicalml/convention/coordinator.rb +89 -0
- data/lib/chemicalml/convention/detection.rb +33 -0
- data/lib/chemicalml/convention/dictionary/constraints/dictionary_must_have_namespace.rb +28 -0
- data/lib/chemicalml/convention/dictionary/constraints/dictionary_namespace_should_end_with_slash_or_hash.rb +32 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_id_must_match_pattern.rb +33 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_ids_unique_within_dictionary.rb +3 -3
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_contain_definition.rb +28 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_id_and_term.rb +5 -5
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_unit_type.rb +30 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_units_co_constraints.rb +44 -0
- data/lib/chemicalml/convention/dictionary/constraints.rb +12 -0
- data/lib/chemicalml/convention/dictionary.rb +6 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_array_must_be_child_of_molecule_or_formula.rb +40 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_array_must_contain_atoms.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/atom_coordinates_must_be_paired.rb +5 -5
- data/lib/chemicalml/convention/molecular/constraints/atom_id_must_match_pattern.rb +4 -4
- data/lib/chemicalml/convention/molecular/constraints/atom_ids_unique_within_molecule.rb +2 -2
- data/lib/chemicalml/convention/molecular/constraints/atom_must_have_element_type.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/atom_must_have_id.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/bond_array_must_be_child_of_molecule.rb +36 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_ids_unique_within_molecule.rb +43 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_must_have_atom_refs2.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/bond_must_have_order.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/bond_must_reference_atoms_in_same_molecule.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/bond_order_other_must_have_dict_ref.rb +33 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_order_should_not_be_numeric.rb +2 -2
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_cis_trans_must_have_atom_refs4.rb +45 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_other_must_have_dict_ref.rb +32 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_wedge_hash_must_have_atom_refs2.rb +45 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_atom_array_mutually_exclusive_with_children.rb +32 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_bond_array_mutually_exclusive_with_children.rb +31 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_count_must_not_appear_on_top_level.rb +34 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_must_have_id.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/property_must_have_dict_ref.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/scalar_must_have_data_type.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints.rb +20 -0
- data/lib/chemicalml/convention/molecular.rb +10 -0
- data/lib/chemicalml/convention/registry.rb +17 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_list_must_contain_at_least_one_unit.rb +28 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_list_must_have_namespace.rb +36 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_contain_definition.rb +27 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_id.rb +27 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_symbol_and_unit_type.rb +3 -3
- data/lib/chemicalml/convention/unit_dictionary/constraints.rb +9 -1
- data/lib/chemicalml/convention/unit_dictionary.rb +4 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_id_must_match_pattern.rb +31 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_list_must_contain_at_least_one_unit_type.rb +27 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_list_must_have_namespace.rb +35 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_contain_definition.rb +27 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_have_id_and_name.rb +5 -5
- data/lib/chemicalml/convention/unit_type_dictionary/constraints.rb +9 -1
- data/lib/chemicalml/convention/unit_type_dictionary.rb +4 -0
- data/lib/chemicalml/convention/validation_report.rb +63 -0
- data/lib/chemicalml/convention.rb +11 -0
- data/lib/chemicalml/dictionary/entry.rb +6 -6
- data/lib/chemicalml/dictionary/enum.rb +1 -1
- data/lib/chemicalml/dictionary/link.rb +3 -3
- data/lib/chemicalml/dictionary/loader.rb +19 -19
- data/lib/chemicalml/dictionary/model.rb +5 -5
- data/lib/chemicalml/dictionary/registry.rb +9 -9
- data/lib/chemicalml/version.rb +1 -1
- data/lib/chemicalml/versioned_parser.rb +18 -0
- data/lib/chemicalml.rb +1 -2
- metadata +123 -34
- data/lib/chemicalml/cml/child_mappings.rb +0 -168
- data/lib/chemicalml/cml/translator/value_translations.rb +0 -270
- data/lib/chemicalml/cml/translator.rb +0 -484
- data/lib/chemicalml/model/atom.rb +0 -64
- data/lib/chemicalml/model/atom_parity.rb +0 -21
- data/lib/chemicalml/model/bond.rb +0 -39
- data/lib/chemicalml/model/bond_stereo.rb +0 -29
- data/lib/chemicalml/model/cml_array.rb +0 -27
- data/lib/chemicalml/model/cml_module.rb +0 -45
- data/lib/chemicalml/model/document.rb +0 -29
- data/lib/chemicalml/model/formula.rb +0 -34
- data/lib/chemicalml/model/identifier.rb +0 -21
- data/lib/chemicalml/model/label.rb +0 -21
- data/lib/chemicalml/model/matrix.rb +0 -29
- data/lib/chemicalml/model/metadata.rb +0 -23
- data/lib/chemicalml/model/metadata_list.rb +0 -25
- data/lib/chemicalml/model/molecule.rb +0 -45
- data/lib/chemicalml/model/name.rb +0 -21
- data/lib/chemicalml/model/node.rb +0 -45
- data/lib/chemicalml/model/parameter.rb +0 -27
- data/lib/chemicalml/model/parameter_list.rb +0 -25
- data/lib/chemicalml/model/product.rb +0 -21
- data/lib/chemicalml/model/product_list.rb +0 -21
- data/lib/chemicalml/model/property.rb +0 -28
- data/lib/chemicalml/model/property_list.rb +0 -25
- data/lib/chemicalml/model/reactant.rb +0 -21
- data/lib/chemicalml/model/reactant_list.rb +0 -21
- data/lib/chemicalml/model/reaction.rb +0 -41
- data/lib/chemicalml/model/reaction_list.rb +0 -23
- data/lib/chemicalml/model/scalar.rb +0 -25
- data/lib/chemicalml/model/substance.rb +0 -25
- data/lib/chemicalml/model.rb +0 -40
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# 50 — ValidationReport with severity filtering
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
`Convention.validate` returns a flat array of `Violation`s. Callers
|
|
6
|
+
that want only errors or only warnings have to filter manually. Add
|
|
7
|
+
a `ValidationReport` value object that wraps the array and exposes
|
|
8
|
+
severity-based views.
|
|
9
|
+
|
|
10
|
+
## API
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
report = Chemicalml::Convention::ValidationReport.new(violations)
|
|
14
|
+
report.errors # [Violation] with severity == :error
|
|
15
|
+
report.warnings # [Violation] with severity == :warning
|
|
16
|
+
report.ok? # errors.empty?
|
|
17
|
+
report.has_warnings? # warnings.any?
|
|
18
|
+
report.violations # raw array (backward compat)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Also add `Convention.validate_report(doc)` returning a
|
|
22
|
+
`ValidationReport` instead of an array. Existing `validate` keeps its
|
|
23
|
+
array return shape (backward compatible).
|
|
24
|
+
|
|
25
|
+
## Acceptance
|
|
26
|
+
|
|
27
|
+
- New spec covers all 5 helpers.
|
|
28
|
+
- Existing validate specs unchanged.
|
|
29
|
+
- Full suite green.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 51 — Convention auto-detection
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
Currently a caller has to know the convention QName and pass it to
|
|
6
|
+
`Convention::Registry.validate(doc, qname: "convention:molecular")`.
|
|
7
|
+
The document itself declares its convention via the `convention`
|
|
8
|
+
attribute on its root element — the gem should be able to detect and
|
|
9
|
+
dispatch automatically.
|
|
10
|
+
|
|
11
|
+
## API
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
Chemicalml::Convention::Registry.detect_and_validate(doc)
|
|
15
|
+
# → [Violation, ...] (or ValidationReport)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Internally:
|
|
19
|
+
1. Find the root element (Document or Molecule or Module).
|
|
20
|
+
2. Read its `convention` attribute.
|
|
21
|
+
3. Look up in `Registry`.
|
|
22
|
+
4. If found → run `convention.validate(doc)`.
|
|
23
|
+
5. If not found → raise ArgumentError naming the convention.
|
|
24
|
+
|
|
25
|
+
## Acceptance
|
|
26
|
+
|
|
27
|
+
- Spec: a doc with `convention="convention:molecular"` auto-validates.
|
|
28
|
+
- Spec: unknown convention raises ArgumentError.
|
|
29
|
+
- Spec: doc without convention raises ArgumentError.
|
|
30
|
+
- Full suite green.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# 52 — Schema24 legacy elements (selective)
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
Schema 2.4 XSD declares 17 elements not in Schema 3. Three of them
|
|
6
|
+
are useful enough to model: `annotation` (documentation wrapper),
|
|
7
|
+
`appinfo` (application info), `enumeration` (dictionary enum, used
|
|
8
|
+
by entries that predate the schema3 enum attribute).
|
|
9
|
+
|
|
10
|
+
The other 14 (`alternative`, `arg`, `complexObject`, `expression`,
|
|
11
|
+
`float`, `floatArray`, `integer`, `integerArray`, `operator`,
|
|
12
|
+
`relatedEntry`, `string`, `stringArray`, `tcell`, `trow`) are either
|
|
13
|
+
redundant with Schema 3's unified `scalar`/`array`/`table` or relate
|
|
14
|
+
to legacy expression machinery. Out of scope for now.
|
|
15
|
+
|
|
16
|
+
## Implementation
|
|
17
|
+
|
|
18
|
+
- Add `Base::Annotation`, `Base::Appinfo`, `Base::Enumeration`.
|
|
19
|
+
- Add `Role::Annotation`, `Role::Appinfo`, `Role::Enumeration`.
|
|
20
|
+
- Add `Schema24::Annotation`, `Schema24::Appinfo`, `Schema24::Enumeration`.
|
|
21
|
+
- Add to `Elements::ALL` with new `SCHEMA24_ONLY` list.
|
|
22
|
+
- Schema3 skips these; Schema24 registers them.
|
|
23
|
+
|
|
24
|
+
## Acceptance
|
|
25
|
+
|
|
26
|
+
- Three new wire classes registered for Schema24 only.
|
|
27
|
+
- Schema3 lookup raises ArgumentError for these (not in Schema 3).
|
|
28
|
+
- Full suite green.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 53 — Round-trip integration specs
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
Per-element translator specs cover individual `*_to_canonical` /
|
|
6
|
+
`*_from_canonical` calls. They miss integration issues — wire-format
|
|
7
|
+
mismatches, attribute renames, namespace leaks — that only surface
|
|
8
|
+
when you go XML → canonical → XML → canonical and compare.
|
|
9
|
+
|
|
10
|
+
## Specs
|
|
11
|
+
|
|
12
|
+
A new `spec/chemicalml/integration/round_trip_spec.rb` that, for each
|
|
13
|
+
fixture under `spec/fixtures/schema3/`:
|
|
14
|
+
|
|
15
|
+
1. Parse the CML XML → wire tree.
|
|
16
|
+
2. Translate wire → canonical Model.
|
|
17
|
+
3. Translate canonical → wire.
|
|
18
|
+
4. Serialize wire → XML.
|
|
19
|
+
5. Re-parse → second wire tree.
|
|
20
|
+
6. Compare first and second wire trees via `value_attributes`.
|
|
21
|
+
|
|
22
|
+
Uses real wire instances throughout (no doubles per project rule).
|
|
23
|
+
Also includes synthetic minimal docs for: crystal-bearing molecule,
|
|
24
|
+
spectrum-bearing molecule, zMatrix molecule, isotopeList molecule.
|
|
25
|
+
|
|
26
|
+
## Acceptance
|
|
27
|
+
|
|
28
|
+
- Every fixture round-trips.
|
|
29
|
+
- Synthetic minimal docs round-trip.
|
|
30
|
+
- Full suite green.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# 54 — Document VersionedParser namespace shim
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
`lib/chemicalml/versioned_parser.rb` uses regex for two pre-processing
|
|
6
|
+
steps before delegating to `lutaml-model`:
|
|
7
|
+
|
|
8
|
+
1. `root_element_of(xml)` — peeks the XML for the root element local
|
|
9
|
+
name so the parser can dispatch to the right wire class.
|
|
10
|
+
2. `inject_namespace(xml, uri, root)` — when the caller passes
|
|
11
|
+
`namespace_exist: false`, injects `xmlns="..."` into the root
|
|
12
|
+
start tag.
|
|
13
|
+
|
|
14
|
+
Both are pre-processing shims. The actual parse goes through
|
|
15
|
+
`Lutaml::Model::Serializable.from_xml` (line 45). Neither function
|
|
16
|
+
serializes, deserializes, or constructs XML nodes — they're string
|
|
17
|
+
pre-processing for input normalization.
|
|
18
|
+
|
|
19
|
+
The user asked to confirm this. The answer:
|
|
20
|
+
|
|
21
|
+
- All actual XML parsing and serialization goes through lutaml-model.
|
|
22
|
+
- 242 wire classes extend `Lutaml::Model::Serializable`.
|
|
23
|
+
- Zero `def to_xml`/`from_xml`/`to_h`/`from_h` on any model class.
|
|
24
|
+
- Zero Nokogiri/REXML references in `lib/`.
|
|
25
|
+
- The two regex helpers in `versioned_parser.rb` are pre-processing
|
|
26
|
+
for input normalization, not serialization. They are explicitly
|
|
27
|
+
documented as such.
|
|
28
|
+
|
|
29
|
+
## Action
|
|
30
|
+
|
|
31
|
+
- Add a clear comment block at the top of `versioned_parser.rb`
|
|
32
|
+
explaining the boundary.
|
|
33
|
+
- No code change.
|
|
34
|
+
|
|
35
|
+
## Acceptance
|
|
36
|
+
|
|
37
|
+
- Comment added.
|
|
38
|
+
- Full suite green.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 55 — Fix Model::Molecule missing attributes (correctness)
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
`Base::Molecule` declares `spin_multiplicity`, `dict_ref`,
|
|
6
|
+
`convention`, `chirality` attributes, but `Model::Molecule` doesn't
|
|
7
|
+
have them and the translator drops them silently. These are
|
|
8
|
+
chemically important (chirality in particular).
|
|
9
|
+
|
|
10
|
+
## Fix
|
|
11
|
+
|
|
12
|
+
Add `spin_multiplicity`, `dict_ref`, `convention`, `chirality` to
|
|
13
|
+
`Model::Molecule`. Update translator molecule_to_canonical and
|
|
14
|
+
molecule_from_canonical to map them.
|
|
15
|
+
|
|
16
|
+
## Acceptance
|
|
17
|
+
|
|
18
|
+
- All 4 attributes round-trip through translator.
|
|
19
|
+
- Existing specs unchanged.
|
|
20
|
+
- Full suite green.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 56 — Geometry Model classes
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
CML declares 6 geometry primitives (`point3`, `vector3`, `line3`,
|
|
6
|
+
`plane3`, `sphere3`, `transform3`) plus `cellParameter` and
|
|
7
|
+
`dimension` — all share the same shape (id/title/dictRef/convention +
|
|
8
|
+
content). They're used as children of `atom`, `molecule`, `crystal`,
|
|
9
|
+
etc. Without canonical Models, callers must use wire classes directly.
|
|
10
|
+
|
|
11
|
+
## Implementation
|
|
12
|
+
|
|
13
|
+
One Model class per element. Each carries `id`, `title`, `dict_ref`,
|
|
14
|
+
`convention`, `content` (the geometry string). Identical shape, so
|
|
15
|
+
specs can be parametrized.
|
|
16
|
+
|
|
17
|
+
For `cellParameter`: also `cellType` attribute (per Schema 3 XSD).
|
|
18
|
+
For `dimension`: also `name` attribute.
|
|
19
|
+
|
|
20
|
+
## Acceptance
|
|
21
|
+
|
|
22
|
+
- 8 new Model classes registered.
|
|
23
|
+
- Per-class spec.
|
|
24
|
+
- Full suite green.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# 57 — Compchem Model classes
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
Schema 3 declares 10 compchem-specific elements not yet modeled:
|
|
6
|
+
`gradient`, `eigen`, `kpoint`, `kpointList`, `band`, `bandList`,
|
|
7
|
+
`basisSet`, `atomicBasisFunction`, `particle`, `electron`. All
|
|
8
|
+
are common in computational chemistry output.
|
|
9
|
+
|
|
10
|
+
## Implementation
|
|
11
|
+
|
|
12
|
+
- `Model::Gradient` — id/title/dictRef/convention/units/content
|
|
13
|
+
- `Model::Eigen` — id/title/dictRef/convention/units/type/content
|
|
14
|
+
- `Model::Kpoint` / `Model::KpointList`
|
|
15
|
+
- `Model::Band` / `Model::BandList`
|
|
16
|
+
- `Model::BasisSet` / `Model::AtomicBasisFunction`
|
|
17
|
+
- `Model::Particle` / `Model::Electron`
|
|
18
|
+
|
|
19
|
+
Each follows the Node pattern: attr_accessor, initialize, children,
|
|
20
|
+
value_attributes.
|
|
21
|
+
|
|
22
|
+
## Acceptance
|
|
23
|
+
|
|
24
|
+
- 10 new Model classes.
|
|
25
|
+
- Per-class spec.
|
|
26
|
+
- Full suite green.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 58 — Remaining Model classes for full element coverage
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
Several wire elements still lack canonical Models, breaking the "all
|
|
6
|
+
adapters speak canonical" invariant for these element types.
|
|
7
|
+
|
|
8
|
+
## New Model classes (25)
|
|
9
|
+
|
|
10
|
+
- **Documentation**: Definition, Description, Documentation, Link
|
|
11
|
+
- **Chemistry**: Symmetry (pointGroup/spaceGroup), System
|
|
12
|
+
(atomArray/molecules), Stmml
|
|
13
|
+
- **Containers**: ArrayList, ConditionList, SubstanceList
|
|
14
|
+
- **Sets**: AtomSet, BondSet
|
|
15
|
+
- **Typing**: AtomType, AtomTypeList, BondType, BondTypeList
|
|
16
|
+
- **Mechanism**: Mechanism, MechanismComponent, Join
|
|
17
|
+
- **Other**: Object, Observation, PeakStructure, Potential,
|
|
18
|
+
PotentialForm, PotentialList
|
|
19
|
+
|
|
20
|
+
## Acceptance
|
|
21
|
+
|
|
22
|
+
- 25 new Model classes.
|
|
23
|
+
- Per-class spec (lightweight — just instantiation + value_attributes).
|
|
24
|
+
- Full suite green.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 59 — Wire new Models through translator
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
Models added in TODOs 56-58 are inert without translator mappings.
|
|
6
|
+
Add `*_to_canonical` / `*_from_canonical` for each.
|
|
7
|
+
|
|
8
|
+
## Implementation
|
|
9
|
+
|
|
10
|
+
Most share the geometry-simple shape (id/title/dictRef/convention +
|
|
11
|
+
content). Factor a shared helper to avoid copy-paste.
|
|
12
|
+
|
|
13
|
+
## Acceptance
|
|
14
|
+
|
|
15
|
+
- Translator spec for each new Model class.
|
|
16
|
+
- Round-trip integration test covers a synthetic doc using one new
|
|
17
|
+
Model class end-to-end.
|
|
18
|
+
- Full suite green.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# 60 — Update CLAUDE.md and final verification
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
Counts in CLAUDE.md and project docs are stale after TODOs 36-59.
|
|
6
|
+
|
|
7
|
+
## Updates
|
|
8
|
+
|
|
9
|
+
- CLAUDE.md model count (was 43, now ~100).
|
|
10
|
+
- Constraint count (was 17, now 60).
|
|
11
|
+
- Note ValidationReport, detect_and_validate APIs.
|
|
12
|
+
- Note Schema24 legacy elements.
|
|
13
|
+
- Verify `bundle exec rspec` fully green.
|
|
14
|
+
- Verify zero forbidden patterns.
|
|
15
|
+
|
|
16
|
+
## Acceptance
|
|
17
|
+
|
|
18
|
+
- Docs reflect current state.
|
|
19
|
+
- Full suite green.
|
|
@@ -12,6 +12,9 @@ module Chemicalml
|
|
|
12
12
|
attribute :dict_ref, :string
|
|
13
13
|
attribute :convention, :string
|
|
14
14
|
|
|
15
|
+
attribute :min, :string
|
|
16
|
+
attribute :max, :string
|
|
17
|
+
attribute :units, :string
|
|
15
18
|
xml do
|
|
16
19
|
namespace Chemicalml::Cml::Namespace
|
|
17
20
|
root "abundance"
|
|
@@ -19,6 +22,9 @@ module Chemicalml
|
|
|
19
22
|
map_attribute "title", to: :title
|
|
20
23
|
map_attribute "dictRef", to: :dict_ref
|
|
21
24
|
map_attribute "convention", to: :convention
|
|
25
|
+
map_attribute "min", to: :min
|
|
26
|
+
map_attribute "max", to: :max
|
|
27
|
+
map_attribute "units", to: :units
|
|
22
28
|
end
|
|
23
29
|
end
|
|
24
30
|
end
|
|
@@ -13,6 +13,16 @@ module Chemicalml
|
|
|
13
13
|
attribute :convention, :string
|
|
14
14
|
attribute :order, :string
|
|
15
15
|
|
|
16
|
+
attribute :units, :string
|
|
17
|
+
attribute :start, :string
|
|
18
|
+
attribute :start_condition, :string
|
|
19
|
+
attribute :duration, :string
|
|
20
|
+
attribute :end, :string
|
|
21
|
+
attribute :end_condition, :string
|
|
22
|
+
attribute :type, :string
|
|
23
|
+
attribute :action_order, :string
|
|
24
|
+
attribute :count, :string
|
|
25
|
+
attribute :ref, :string
|
|
16
26
|
xml do
|
|
17
27
|
namespace Chemicalml::Cml::Namespace
|
|
18
28
|
root "action"
|
|
@@ -21,6 +31,16 @@ module Chemicalml
|
|
|
21
31
|
map_attribute "dictRef", to: :dict_ref
|
|
22
32
|
map_attribute "convention", to: :convention
|
|
23
33
|
map_attribute "order", to: :order
|
|
34
|
+
map_attribute "units", to: :units
|
|
35
|
+
map_attribute "start", to: :start
|
|
36
|
+
map_attribute "startCondition", to: :start_condition
|
|
37
|
+
map_attribute "duration", to: :duration
|
|
38
|
+
map_attribute "end", to: :end
|
|
39
|
+
map_attribute "endCondition", to: :end_condition
|
|
40
|
+
map_attribute "type", to: :type
|
|
41
|
+
map_attribute "actionOrder", to: :action_order
|
|
42
|
+
map_attribute "count", to: :count
|
|
43
|
+
map_attribute "ref", to: :ref
|
|
24
44
|
end
|
|
25
45
|
end
|
|
26
46
|
end
|
|
@@ -15,6 +15,15 @@ module Chemicalml
|
|
|
15
15
|
|
|
16
16
|
attribute :actions, :action, collection: true
|
|
17
17
|
|
|
18
|
+
attribute :start, :string
|
|
19
|
+
attribute :start_condition, :string
|
|
20
|
+
attribute :duration, :string
|
|
21
|
+
attribute :end, :string
|
|
22
|
+
attribute :end_condition, :string
|
|
23
|
+
attribute :units, :string
|
|
24
|
+
attribute :count, :string
|
|
25
|
+
attribute :type, :string
|
|
26
|
+
attribute :action_order, :string
|
|
18
27
|
xml do
|
|
19
28
|
namespace Chemicalml::Cml::Namespace
|
|
20
29
|
map_element "action", to: :actions
|
|
@@ -24,6 +33,15 @@ module Chemicalml
|
|
|
24
33
|
map_attribute "dictRef", to: :dict_ref
|
|
25
34
|
map_attribute "convention", to: :convention
|
|
26
35
|
map_attribute "order", to: :order
|
|
36
|
+
map_attribute "start", to: :start
|
|
37
|
+
map_attribute "startCondition", to: :start_condition
|
|
38
|
+
map_attribute "duration", to: :duration
|
|
39
|
+
map_attribute "end", to: :end
|
|
40
|
+
map_attribute "endCondition", to: :end_condition
|
|
41
|
+
map_attribute "units", to: :units
|
|
42
|
+
map_attribute "count", to: :count
|
|
43
|
+
map_attribute "type", to: :type
|
|
44
|
+
map_attribute "actionOrder", to: :action_order
|
|
27
45
|
end
|
|
28
46
|
end
|
|
29
47
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Alternative
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Alternative
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :convention, :string
|
|
12
|
+
attribute :alternative_type, :string
|
|
13
|
+
attribute :content, :string
|
|
14
|
+
|
|
15
|
+
xml do
|
|
16
|
+
namespace Chemicalml::Cml::Namespace
|
|
17
|
+
root "alternative"
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "convention", to: :convention
|
|
20
|
+
map_attribute "alternativeType", to: :alternative_type
|
|
21
|
+
map_content to: :content
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -12,6 +12,7 @@ module Chemicalml
|
|
|
12
12
|
attribute :dict_ref, :string
|
|
13
13
|
attribute :convention, :string
|
|
14
14
|
|
|
15
|
+
attribute :units, :string
|
|
15
16
|
xml do
|
|
16
17
|
namespace Chemicalml::Cml::Namespace
|
|
17
18
|
root "amount"
|
|
@@ -19,6 +20,7 @@ module Chemicalml
|
|
|
19
20
|
map_attribute "title", to: :title
|
|
20
21
|
map_attribute "dictRef", to: :dict_ref
|
|
21
22
|
map_attribute "convention", to: :convention
|
|
23
|
+
map_attribute "units", to: :units
|
|
22
24
|
end
|
|
23
25
|
end
|
|
24
26
|
end
|
|
@@ -14,6 +14,12 @@ module Chemicalml
|
|
|
14
14
|
attribute :atomRefs3, :string
|
|
15
15
|
attribute :units, :string
|
|
16
16
|
|
|
17
|
+
attribute :angle_units, :string
|
|
18
|
+
attribute :error_value, :string
|
|
19
|
+
attribute :error_basis, :string
|
|
20
|
+
attribute :min, :string
|
|
21
|
+
attribute :max, :string
|
|
22
|
+
attribute :ref, :string
|
|
17
23
|
xml do
|
|
18
24
|
namespace Chemicalml::Cml::Namespace
|
|
19
25
|
root "angle"
|
|
@@ -23,6 +29,12 @@ module Chemicalml
|
|
|
23
29
|
map_attribute "convention", to: :convention
|
|
24
30
|
map_attribute "atomRefs3", to: :atomRefs3
|
|
25
31
|
map_attribute "units", to: :units
|
|
32
|
+
map_attribute "angleUnits", to: :angle_units
|
|
33
|
+
map_attribute "errorValue", to: :error_value
|
|
34
|
+
map_attribute "errorBasis", to: :error_basis
|
|
35
|
+
map_attribute "min", to: :min
|
|
36
|
+
map_attribute "max", to: :max
|
|
37
|
+
map_attribute "ref", to: :ref
|
|
26
38
|
end
|
|
27
39
|
end
|
|
28
40
|
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Annotation
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Annotation
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :convention, :string
|
|
14
|
+
attribute :documentation, :documentation
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
namespace Chemicalml::Cml::Namespace
|
|
18
|
+
root "annotation"
|
|
19
|
+
map_attribute "id", to: :id
|
|
20
|
+
map_attribute "title", to: :title
|
|
21
|
+
map_attribute "dictRef", to: :dict_ref
|
|
22
|
+
map_attribute "convention", to: :convention
|
|
23
|
+
map_element "documentation", to: :documentation
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Appinfo
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Appinfo
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :convention, :string
|
|
14
|
+
attribute :content, :string
|
|
15
|
+
|
|
16
|
+
attribute :role, :string
|
|
17
|
+
xml do
|
|
18
|
+
namespace Chemicalml::Cml::Namespace
|
|
19
|
+
root "appinfo"
|
|
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_content to: :content
|
|
25
|
+
map_attribute "role", to: :role
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Arg
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Arg
|
|
10
|
+
attribute :title, :string
|
|
11
|
+
attribute :id, :string
|
|
12
|
+
attribute :convention, :string
|
|
13
|
+
attribute :dict_ref, :string
|
|
14
|
+
attribute :ref, :string
|
|
15
|
+
attribute :name, :string
|
|
16
|
+
attribute :data_type, :string
|
|
17
|
+
attribute :substitute, :string
|
|
18
|
+
attribute :parameter_name, :string
|
|
19
|
+
attribute :parent_attribute, :string
|
|
20
|
+
attribute :delete, :string
|
|
21
|
+
attribute :eval, :string
|
|
22
|
+
attribute :content, :string
|
|
23
|
+
|
|
24
|
+
xml do
|
|
25
|
+
namespace Chemicalml::Cml::Namespace
|
|
26
|
+
root "arg"
|
|
27
|
+
map_attribute "title", to: :title
|
|
28
|
+
map_attribute "id", to: :id
|
|
29
|
+
map_attribute "convention", to: :convention
|
|
30
|
+
map_attribute "dictRef", to: :dict_ref
|
|
31
|
+
map_attribute "ref", to: :ref
|
|
32
|
+
map_attribute "name", to: :name
|
|
33
|
+
map_attribute "dataType", to: :data_type
|
|
34
|
+
map_attribute "substitute", to: :substitute
|
|
35
|
+
map_attribute "parameterName", to: :parameter_name
|
|
36
|
+
map_attribute "parentAttribute", to: :parent_attribute
|
|
37
|
+
map_attribute "delete", to: :delete
|
|
38
|
+
map_attribute "eval", to: :eval
|
|
39
|
+
map_content to: :content
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -16,6 +16,17 @@ module Chemicalml
|
|
|
16
16
|
attribute :delimiter, :string
|
|
17
17
|
attribute :content, :string
|
|
18
18
|
|
|
19
|
+
attribute :convention, :string
|
|
20
|
+
attribute :error_value_array, :string
|
|
21
|
+
attribute :error_basis, :string
|
|
22
|
+
attribute :min_value_array, :string
|
|
23
|
+
attribute :max_value_array, :string
|
|
24
|
+
attribute :start, :string
|
|
25
|
+
attribute :end, :string
|
|
26
|
+
attribute :ref, :string
|
|
27
|
+
attribute :constant_to_s_i, :string
|
|
28
|
+
attribute :multiplier_to_s_i, :string
|
|
29
|
+
attribute :unit_type, :string
|
|
19
30
|
xml do
|
|
20
31
|
namespace Chemicalml::Cml::Namespace
|
|
21
32
|
root "array"
|
|
@@ -27,6 +38,17 @@ module Chemicalml
|
|
|
27
38
|
map_attribute "size", to: :size
|
|
28
39
|
map_attribute "delimiter", to: :delimiter
|
|
29
40
|
map_content to: :content
|
|
41
|
+
map_attribute "convention", to: :convention
|
|
42
|
+
map_attribute "errorValueArray", to: :error_value_array
|
|
43
|
+
map_attribute "errorBasis", to: :error_basis
|
|
44
|
+
map_attribute "minValueArray", to: :min_value_array
|
|
45
|
+
map_attribute "maxValueArray", to: :max_value_array
|
|
46
|
+
map_attribute "start", to: :start
|
|
47
|
+
map_attribute "end", to: :end
|
|
48
|
+
map_attribute "ref", to: :ref
|
|
49
|
+
map_attribute "constantToSI", to: :constant_to_s_i
|
|
50
|
+
map_attribute "multiplierToSI", to: :multiplier_to_s_i
|
|
51
|
+
map_attribute "unitType", to: :unit_type
|
|
30
52
|
end
|
|
31
53
|
end
|
|
32
54
|
end
|
|
@@ -12,6 +12,7 @@ module Chemicalml
|
|
|
12
12
|
attribute :dict_ref, :string
|
|
13
13
|
attribute :convention, :string
|
|
14
14
|
|
|
15
|
+
attribute :shape, :string
|
|
15
16
|
xml do
|
|
16
17
|
namespace Chemicalml::Cml::Namespace
|
|
17
18
|
root "arrayList"
|
|
@@ -19,6 +20,7 @@ module Chemicalml
|
|
|
19
20
|
map_attribute "title", to: :title
|
|
20
21
|
map_attribute "dictRef", to: :dict_ref
|
|
21
22
|
map_attribute "convention", to: :convention
|
|
23
|
+
map_attribute "shape", to: :shape
|
|
22
24
|
end
|
|
23
25
|
end
|
|
24
26
|
end
|
|
@@ -26,6 +26,15 @@ module Chemicalml
|
|
|
26
26
|
attribute :zFract, :string
|
|
27
27
|
attribute :atom_parity, :atomParity
|
|
28
28
|
|
|
29
|
+
attribute :convention, :string
|
|
30
|
+
attribute :dict_ref, :string
|
|
31
|
+
attribute :ref, :string
|
|
32
|
+
attribute :isotope_ref, :string
|
|
33
|
+
attribute :isotope_list_ref, :string
|
|
34
|
+
attribute :occupancy, :string
|
|
35
|
+
attribute :role, :string
|
|
36
|
+
attribute :space_group_multiplicity, :string
|
|
37
|
+
attribute :point_group_multiplicity, :string
|
|
29
38
|
xml do
|
|
30
39
|
namespace Chemicalml::Cml::Namespace
|
|
31
40
|
root "atom"
|
|
@@ -47,6 +56,15 @@ module Chemicalml
|
|
|
47
56
|
map_attribute "yFract", to: :yFract
|
|
48
57
|
map_attribute "zFract", to: :zFract
|
|
49
58
|
map_element "atomParity", to: :atom_parity
|
|
59
|
+
map_attribute "convention", to: :convention
|
|
60
|
+
map_attribute "dictRef", to: :dict_ref
|
|
61
|
+
map_attribute "ref", to: :ref
|
|
62
|
+
map_attribute "isotopeRef", to: :isotope_ref
|
|
63
|
+
map_attribute "isotopeListRef", to: :isotope_list_ref
|
|
64
|
+
map_attribute "occupancy", to: :occupancy
|
|
65
|
+
map_attribute "role", to: :role
|
|
66
|
+
map_attribute "spaceGroupMultiplicity", to: :space_group_multiplicity
|
|
67
|
+
map_attribute "pointGroupMultiplicity", to: :point_group_multiplicity
|
|
50
68
|
end
|
|
51
69
|
end
|
|
52
70
|
end
|