chemicalml 0.2.1 → 0.4.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.
Files changed (352) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +21 -14
  3. data/.rubocop.yml +23 -0
  4. data/CHANGELOG.md +32 -0
  5. data/CLAUDE.md +49 -1
  6. data/README.adoc +154 -26
  7. data/TODO.align/61-parallel-array-attrs.md +54 -0
  8. data/TODO.align/62-per-element-attribute-gaps.md +49 -0
  9. data/TODO.align/63-universal-children-mixin.md +42 -0
  10. data/TODO.align/64-per-element-child-gaps.md +81 -0
  11. data/TODO.align/65-simple-unit-convention.md +40 -0
  12. data/TODO.align/66-schema24-legacy-children.md +32 -0
  13. data/TODO.align/67-final-verification.md +32 -0
  14. data/TODO.align/68-detection-coverage.md +33 -0
  15. data/TODO.align/69-json-yaml-roundtrip.md +27 -0
  16. data/TODO.align/70-iterative-walker.md +40 -0
  17. data/TODO.align/71-violation-value.md +25 -0
  18. data/TODO.align/72-close-child-gaps.md +66 -0
  19. data/TODO.align/73-schema24-parse-limitation.md +64 -0
  20. data/TODO.align/74-final-verification-round18.md +15 -0
  21. data/TODO.align/75-key-value-mappings.md +43 -0
  22. data/TODO.align/76-schema24-workaround.md +57 -0
  23. data/TODO.align/77-convention-coverage-matrix.md +31 -0
  24. data/TODO.align/78-fixture-audit.md +23 -0
  25. data/TODO.align/79-final-verification-round19.md +15 -0
  26. data/TODO.align/80-xsd-enum-constants.md +35 -0
  27. data/TODO.align/81-enum-validation-constraints.md +29 -0
  28. data/TODO.align/82-reference-resolver.md +33 -0
  29. data/TODO.align/83-toml-roundtrip.md +20 -0
  30. data/TODO.align/84-final-verification-round21.md +16 -0
  31. data/TODO.align/85-bond-distinct-atoms.md +25 -0
  32. data/TODO.align/86-references-should-resolve.md +20 -0
  33. data/TODO.align/87-cli-utility.md +26 -0
  34. data/TODO.align/88-diverse-fixtures.md +26 -0
  35. data/TODO.align/89-final-verification-round22.md +15 -0
  36. data/TODO.align/90-bond-stereo-completeness.md +31 -0
  37. data/TODO.align/91-atomparity-distinct.md +21 -0
  38. data/TODO.align/92-unit-dictionary-completeness.md +28 -0
  39. data/TODO.align/93-yard-docs.md +23 -0
  40. data/TODO.align/94-final-verification-round23.md +15 -0
  41. data/TODO.align/README.round17.md +28 -0
  42. data/TODO.align/README.round18.md +37 -0
  43. data/TODO.align/README.round19.md +40 -0
  44. data/TODO.align/README.round20.md +49 -0
  45. data/TODO.align/README.round21.md +35 -0
  46. data/TODO.align/README.round22.md +48 -0
  47. data/TODO.align/README.round23.md +46 -0
  48. data/TODO.align/README.round24.md +53 -0
  49. data/TODO.align/README.round25.md +66 -0
  50. data/TODO.align/README.round26.md +55 -0
  51. data/TODO.align/README.round27.md +51 -0
  52. data/TODO.align/README.round28.md +61 -0
  53. data/TODO.align/README.round29.md +64 -0
  54. data/TODO.align/README.round30.md +50 -0
  55. data/TODO.align/README.round31.md +54 -0
  56. data/TODO.align/README.round32.md +67 -0
  57. data/TODO.align/README.round33.md +62 -0
  58. data/TODO.align/README.round34.md +70 -0
  59. data/chemicalml.gemspec +1 -1
  60. data/docs/constraints.md +161 -0
  61. data/docs/generate_constraint_docs.rb +44 -0
  62. data/exe/chemicalml +6 -0
  63. data/lib/chemicalml/cli/base.rb +68 -0
  64. data/lib/chemicalml/cli/command.rb +43 -0
  65. data/lib/chemicalml/cli/constraints_command.rb +27 -0
  66. data/lib/chemicalml/cli/conventions_command.rb +14 -0
  67. data/lib/chemicalml/cli/dictionaries_command.rb +14 -0
  68. data/lib/chemicalml/cli/elements_command.rb +17 -0
  69. data/lib/chemicalml/cli/enums_command.rb +17 -0
  70. data/lib/chemicalml/cli/info_command.rb +77 -0
  71. data/lib/chemicalml/cli/inspect_command.rb +39 -0
  72. data/lib/chemicalml/cli/validate_command.rb +54 -0
  73. data/lib/chemicalml/cli.rb +43 -0
  74. data/lib/chemicalml/cml/base/abundance.rb +18 -8
  75. data/lib/chemicalml/cml/base/action.rb +34 -16
  76. data/lib/chemicalml/cml/base/action_list.rb +35 -17
  77. data/lib/chemicalml/cml/base/alternative.rb +13 -4
  78. data/lib/chemicalml/cml/base/amount.rb +14 -6
  79. data/lib/chemicalml/cml/base/angle.rb +28 -13
  80. data/lib/chemicalml/cml/base/annotation.rb +14 -6
  81. data/lib/chemicalml/cml/base/any_cml.rb +12 -5
  82. data/lib/chemicalml/cml/base/appinfo.rb +14 -6
  83. data/lib/chemicalml/cml/base/arg.rb +47 -13
  84. data/lib/chemicalml/cml/base/array.rb +40 -19
  85. data/lib/chemicalml/cml/base/array_list.rb +14 -6
  86. data/lib/chemicalml/cml/base/atom.rb +84 -28
  87. data/lib/chemicalml/cml/base/atom_array.rb +60 -23
  88. data/lib/chemicalml/cml/base/atom_parity.rb +14 -6
  89. data/lib/chemicalml/cml/base/atom_set.rb +14 -6
  90. data/lib/chemicalml/cml/base/atom_type.rb +25 -9
  91. data/lib/chemicalml/cml/base/atom_type_list.rb +22 -8
  92. data/lib/chemicalml/cml/base/atomic_basis_function.rb +33 -13
  93. data/lib/chemicalml/cml/base/band.rb +21 -8
  94. data/lib/chemicalml/cml/base/band_list.rb +15 -7
  95. data/lib/chemicalml/cml/base/basis_set.rb +24 -9
  96. data/lib/chemicalml/cml/base/bond.rb +36 -10
  97. data/lib/chemicalml/cml/base/bond_array.rb +34 -11
  98. data/lib/chemicalml/cml/base/bond_set.rb +14 -6
  99. data/lib/chemicalml/cml/base/bond_stereo.rb +20 -9
  100. data/lib/chemicalml/cml/base/bond_type.rb +23 -8
  101. data/lib/chemicalml/cml/base/bond_type_list.rb +22 -8
  102. data/lib/chemicalml/cml/base/cell_parameter.rb +28 -10
  103. data/lib/chemicalml/cml/base/cml_module.rb +42 -11
  104. data/lib/chemicalml/cml/base/common_children.rb +35 -0
  105. data/lib/chemicalml/cml/base/complex_object.rb +12 -5
  106. data/lib/chemicalml/cml/base/condition_list.rb +26 -10
  107. data/lib/chemicalml/cml/base/crystal.rb +26 -10
  108. data/lib/chemicalml/cml/base/definition.rb +14 -5
  109. data/lib/chemicalml/cml/base/description.rb +16 -6
  110. data/lib/chemicalml/cml/base/dictionary.rb +28 -11
  111. data/lib/chemicalml/cml/base/dictionary_entry.rb +69 -10
  112. data/lib/chemicalml/cml/base/dimension.rb +26 -12
  113. data/lib/chemicalml/cml/base/document.rb +24 -8
  114. data/lib/chemicalml/cml/base/documentation.rb +12 -5
  115. data/lib/chemicalml/cml/base/eigen.rb +32 -8
  116. data/lib/chemicalml/cml/base/electron.rb +26 -12
  117. data/lib/chemicalml/cml/base/enumeration.rb +16 -7
  118. data/lib/chemicalml/cml/base/expression.rb +21 -6
  119. data/lib/chemicalml/cml/base/float.rb +22 -10
  120. data/lib/chemicalml/cml/base/float_array.rb +24 -11
  121. data/lib/chemicalml/cml/base/formula.rb +31 -10
  122. data/lib/chemicalml/cml/base/fragment.rb +30 -12
  123. data/lib/chemicalml/cml/base/fragment_list.rb +24 -9
  124. data/lib/chemicalml/cml/base/gradient.rb +19 -6
  125. data/lib/chemicalml/cml/base/identifier.rb +18 -8
  126. data/lib/chemicalml/cml/base/integer.rb +22 -10
  127. data/lib/chemicalml/cml/base/integer_array.rb +24 -11
  128. data/lib/chemicalml/cml/base/isotope.rb +28 -9
  129. data/lib/chemicalml/cml/base/isotope_list.rb +17 -8
  130. data/lib/chemicalml/cml/base/join.rb +25 -9
  131. data/lib/chemicalml/cml/base/kpoint.rb +16 -7
  132. data/lib/chemicalml/cml/base/kpoint_list.rb +15 -7
  133. data/lib/chemicalml/cml/base/label.rb +14 -6
  134. data/lib/chemicalml/cml/base/lattice.rb +35 -10
  135. data/lib/chemicalml/cml/base/lattice_vector.rb +16 -7
  136. data/lib/chemicalml/cml/base/length.rb +26 -12
  137. data/lib/chemicalml/cml/base/line3.rb +18 -8
  138. data/lib/chemicalml/cml/base/link.rb +41 -20
  139. data/lib/chemicalml/cml/base/list.rb +22 -10
  140. data/lib/chemicalml/cml/base/map.rb +32 -11
  141. data/lib/chemicalml/cml/base/matrix.rb +32 -15
  142. data/lib/chemicalml/cml/base/mechanism.rb +20 -7
  143. data/lib/chemicalml/cml/base/mechanism_component.rb +14 -6
  144. data/lib/chemicalml/cml/base/metadata.rb +18 -8
  145. data/lib/chemicalml/cml/base/metadata_list.rb +27 -8
  146. data/lib/chemicalml/cml/base/molecule.rb +92 -26
  147. data/lib/chemicalml/cml/base/molecule_list.rb +26 -8
  148. data/lib/chemicalml/cml/base/name.rb +10 -4
  149. data/lib/chemicalml/cml/base/object.rb +18 -8
  150. data/lib/chemicalml/cml/base/observation.rb +16 -7
  151. data/lib/chemicalml/cml/base/operator.rb +14 -6
  152. data/lib/chemicalml/cml/base/parameter.rb +33 -13
  153. data/lib/chemicalml/cml/base/parameter_list.rb +27 -8
  154. data/lib/chemicalml/cml/base/particle.rb +20 -9
  155. data/lib/chemicalml/cml/base/peak.rb +73 -26
  156. data/lib/chemicalml/cml/base/peak_group.rb +62 -26
  157. data/lib/chemicalml/cml/base/peak_list.rb +24 -9
  158. data/lib/chemicalml/cml/base/peak_structure.rb +40 -13
  159. data/lib/chemicalml/cml/base/plane3.rb +14 -6
  160. data/lib/chemicalml/cml/base/point3.rb +14 -6
  161. data/lib/chemicalml/cml/base/potential.rb +17 -6
  162. data/lib/chemicalml/cml/base/potential_form.rb +30 -7
  163. data/lib/chemicalml/cml/base/potential_list.rb +15 -7
  164. data/lib/chemicalml/cml/base/product.rb +45 -10
  165. data/lib/chemicalml/cml/base/product_list.rb +29 -9
  166. data/lib/chemicalml/cml/base/property.rb +29 -11
  167. data/lib/chemicalml/cml/base/property_list.rb +23 -8
  168. data/lib/chemicalml/cml/base/reactant.rb +45 -10
  169. data/lib/chemicalml/cml/base/reactant_list.rb +29 -9
  170. data/lib/chemicalml/cml/base/reaction.rb +74 -20
  171. data/lib/chemicalml/cml/base/reaction_list.rb +23 -8
  172. data/lib/chemicalml/cml/base/reaction_scheme.rb +43 -13
  173. data/lib/chemicalml/cml/base/reaction_step.rb +30 -12
  174. data/lib/chemicalml/cml/base/reaction_step_list.rb +30 -11
  175. data/lib/chemicalml/cml/base/reactive_centre.rb +31 -6
  176. data/lib/chemicalml/cml/base/region.rb +20 -9
  177. data/lib/chemicalml/cml/base/related_entry.rb +11 -3
  178. data/lib/chemicalml/cml/base/sample.rb +30 -7
  179. data/lib/chemicalml/cml/base/scalar.rb +32 -15
  180. data/lib/chemicalml/cml/base/spectator.rb +25 -6
  181. data/lib/chemicalml/cml/base/spectator_list.rb +20 -7
  182. data/lib/chemicalml/cml/base/spectrum.rb +57 -18
  183. data/lib/chemicalml/cml/base/spectrum_data.rb +19 -9
  184. data/lib/chemicalml/cml/base/spectrum_list.rb +28 -9
  185. data/lib/chemicalml/cml/base/sphere3.rb +14 -6
  186. data/lib/chemicalml/cml/base/stmml.rb +12 -5
  187. data/lib/chemicalml/cml/base/string.rb +14 -6
  188. data/lib/chemicalml/cml/base/string_array.rb +22 -10
  189. data/lib/chemicalml/cml/base/substance.rb +36 -14
  190. data/lib/chemicalml/cml/base/substance_list.rb +29 -10
  191. data/lib/chemicalml/cml/base/symmetry.rb +31 -9
  192. data/lib/chemicalml/cml/base/system.rb +21 -10
  193. data/lib/chemicalml/cml/base/table.rb +38 -13
  194. data/lib/chemicalml/cml/base/table_cell.rb +12 -5
  195. data/lib/chemicalml/cml/base/table_content.rb +19 -9
  196. data/lib/chemicalml/cml/base/table_header.rb +15 -7
  197. data/lib/chemicalml/cml/base/table_header_cell.rb +22 -10
  198. data/lib/chemicalml/cml/base/table_row.rb +15 -7
  199. data/lib/chemicalml/cml/base/table_row_list.rb +15 -7
  200. data/lib/chemicalml/cml/base/tcell.rb +16 -7
  201. data/lib/chemicalml/cml/base/torsion.rb +28 -13
  202. data/lib/chemicalml/cml/base/transform3.rb +12 -5
  203. data/lib/chemicalml/cml/base/transition_state.rb +23 -5
  204. data/lib/chemicalml/cml/base/trow.rb +22 -6
  205. data/lib/chemicalml/cml/base/unit.rb +39 -16
  206. data/lib/chemicalml/cml/base/unit_list.rb +34 -12
  207. data/lib/chemicalml/cml/base/unit_type.rb +30 -10
  208. data/lib/chemicalml/cml/base/unit_type_list.rb +29 -11
  209. data/lib/chemicalml/cml/base/vector3.rb +14 -6
  210. data/lib/chemicalml/cml/base/xaxis.rb +32 -10
  211. data/lib/chemicalml/cml/base/yaxis.rb +30 -10
  212. data/lib/chemicalml/cml/base/z_matrix.rb +26 -5
  213. data/lib/chemicalml/cml/base.rb +139 -138
  214. data/lib/chemicalml/cml/canonical_comparison.rb +54 -0
  215. data/lib/chemicalml/cml/elements.rb +145 -136
  216. data/lib/chemicalml/cml/enums.rb +55 -0
  217. data/lib/chemicalml/cml/namespace.rb +2 -3
  218. data/lib/chemicalml/cml/patterns.rb +33 -0
  219. data/lib/chemicalml/cml/reference_resolver.rb +137 -0
  220. data/lib/chemicalml/cml/role.rb +138 -138
  221. data/lib/chemicalml/cml/schema24/configuration.rb +11 -1
  222. data/lib/chemicalml/cml/schema24.rb +139 -139
  223. data/lib/chemicalml/cml/schema3.rb +123 -123
  224. data/lib/chemicalml/cml/visitable.rb +77 -3
  225. data/lib/chemicalml/cml/wire_class_registry.rb +3 -3
  226. data/lib/chemicalml/cml/xhtml/p.rb +21 -0
  227. data/lib/chemicalml/cml/xhtml.rb +20 -0
  228. data/lib/chemicalml/cml.rb +164 -129
  229. data/lib/chemicalml/context_configuration.rb +4 -2
  230. data/lib/chemicalml/convention/cascade/constraints/reaction_scheme_must_have_content.rb +33 -0
  231. data/lib/chemicalml/convention/cascade/constraints/reaction_step_list_must_contain_steps.rb +31 -0
  232. data/lib/chemicalml/convention/cascade/constraints/reaction_step_must_have_reaction_or_lists.rb +33 -0
  233. data/lib/chemicalml/convention/cascade/constraints/reactive_centre_atom_refs_should_be_present.rb +34 -0
  234. data/lib/chemicalml/convention/cascade/constraints.rb +18 -0
  235. data/lib/chemicalml/convention/cascade.rb +43 -0
  236. data/lib/chemicalml/convention/compchem/constraints/array_rules.rb +1 -1
  237. data/lib/chemicalml/convention/compchem/constraints/calculation_requires_finalization.rb +1 -1
  238. data/lib/chemicalml/convention/compchem/constraints/compchem_module_must_contain_job_list.rb +2 -1
  239. data/lib/chemicalml/convention/compchem/constraints/environment_at_most_one_property_list.rb +1 -1
  240. data/lib/chemicalml/convention/compchem/constraints/environment_must_not_contain_parameter.rb +1 -1
  241. data/lib/chemicalml/convention/compchem/constraints/finalization_at_most_one_molecule.rb +1 -1
  242. data/lib/chemicalml/convention/compchem/constraints/finalization_at_most_one_property_list.rb +1 -1
  243. data/lib/chemicalml/convention/compchem/constraints/finalization_must_have_content.rb +44 -0
  244. data/lib/chemicalml/convention/compchem/constraints/finalization_must_not_contain_parameter.rb +1 -1
  245. data/lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_molecule.rb +1 -1
  246. data/lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_parameter_list.rb +1 -1
  247. data/lib/chemicalml/convention/compchem/constraints/initialization_must_have_content.rb +54 -0
  248. data/lib/chemicalml/convention/compchem/constraints/initialization_must_not_contain_property.rb +1 -1
  249. data/lib/chemicalml/convention/compchem/constraints/job_list_module_must_have_id.rb +1 -0
  250. data/lib/chemicalml/convention/compchem/constraints/job_module_at_most_one_environment.rb +1 -1
  251. data/lib/chemicalml/convention/compchem/constraints/job_module_at_most_one_finalization.rb +1 -1
  252. data/lib/chemicalml/convention/compchem/constraints/job_module_must_have_id.rb +1 -0
  253. data/lib/chemicalml/convention/compchem/constraints/job_must_contain_initialization.rb +1 -0
  254. data/lib/chemicalml/convention/compchem/constraints/matrix_rules.rb +1 -1
  255. data/lib/chemicalml/convention/compchem/constraints/scalar_units.rb +1 -1
  256. data/lib/chemicalml/convention/compchem/constraints.rb +4 -0
  257. data/lib/chemicalml/convention/compchem.rb +4 -2
  258. data/lib/chemicalml/convention/constraint.rb +40 -9
  259. data/lib/chemicalml/convention/coordinator.rb +4 -3
  260. data/lib/chemicalml/convention/detection.rb +10 -4
  261. data/lib/chemicalml/convention/dictionary/constraints/dictionary_must_have_namespace.rb +1 -0
  262. data/lib/chemicalml/convention/dictionary/constraints/dictionary_namespace_should_end_with_slash_or_hash.rb +1 -1
  263. data/lib/chemicalml/convention/dictionary/constraints/entry_id_must_match_pattern.rb +1 -1
  264. data/lib/chemicalml/convention/dictionary/constraints/entry_ids_unique_within_dictionary.rb +1 -1
  265. data/lib/chemicalml/convention/dictionary/constraints/entry_must_contain_definition.rb +15 -1
  266. data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_id_and_term.rb +1 -1
  267. data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_unit_type.rb +1 -0
  268. data/lib/chemicalml/convention/dictionary/constraints/entry_units_co_constraints.rb +1 -1
  269. data/lib/chemicalml/convention/dictionary/constraints.rb +8 -8
  270. data/lib/chemicalml/convention/dictionary.rb +2 -2
  271. data/lib/chemicalml/convention/molecular/constraints/atom_array_must_be_child_of_molecule_or_formula.rb +1 -0
  272. data/lib/chemicalml/convention/molecular/constraints/atom_array_must_contain_atoms.rb +15 -6
  273. data/lib/chemicalml/convention/molecular/constraints/atom_coordinates_must_be_paired.rb +1 -1
  274. data/lib/chemicalml/convention/molecular/constraints/atom_element_type_should_be_in_periodic_table.rb +39 -0
  275. data/lib/chemicalml/convention/molecular/constraints/atom_id_must_match_pattern.rb +3 -2
  276. data/lib/chemicalml/convention/molecular/constraints/atom_ids_unique_within_molecule.rb +1 -0
  277. data/lib/chemicalml/convention/molecular/constraints/atom_must_have_element_type.rb +1 -1
  278. data/lib/chemicalml/convention/molecular/constraints/atom_must_have_id.rb +2 -1
  279. data/lib/chemicalml/convention/molecular/constraints/atom_parity_atom_refs4_should_be_distinct.rb +44 -0
  280. data/lib/chemicalml/convention/molecular/constraints/atom_parity_should_include_parent_atom.rb +65 -0
  281. data/lib/chemicalml/convention/molecular/constraints/bond_array_must_be_child_of_molecule.rb +1 -0
  282. data/lib/chemicalml/convention/molecular/constraints/bond_atom_refs2_should_be_distinct.rb +44 -0
  283. data/lib/chemicalml/convention/molecular/constraints/bond_id_should_match_pattern.rb +38 -0
  284. data/lib/chemicalml/convention/molecular/constraints/bond_ids_unique_within_molecule.rb +1 -0
  285. data/lib/chemicalml/convention/molecular/constraints/bond_must_have_atom_refs2.rb +1 -1
  286. data/lib/chemicalml/convention/molecular/constraints/bond_must_have_order.rb +2 -1
  287. data/lib/chemicalml/convention/molecular/constraints/bond_must_reference_atoms_in_same_molecule.rb +1 -0
  288. data/lib/chemicalml/convention/molecular/constraints/bond_order_other_must_have_dict_ref.rb +1 -0
  289. data/lib/chemicalml/convention/molecular/constraints/bond_order_should_be_in_enum.rb +39 -0
  290. data/lib/chemicalml/convention/molecular/constraints/bond_order_should_not_be_numeric.rb +1 -1
  291. data/lib/chemicalml/convention/molecular/constraints/bond_stereo_atom_refs4_should_be_distinct.rb +43 -0
  292. data/lib/chemicalml/convention/molecular/constraints/bond_stereo_cis_trans_must_have_atom_refs4.rb +1 -1
  293. data/lib/chemicalml/convention/molecular/constraints/bond_stereo_other_must_have_dict_ref.rb +1 -0
  294. data/lib/chemicalml/convention/molecular/constraints/bond_stereo_should_be_in_enum.rb +38 -0
  295. data/lib/chemicalml/convention/molecular/constraints/bond_stereo_wedge_hash_must_have_atom_refs2.rb +1 -1
  296. data/lib/chemicalml/convention/molecular/constraints/dict_ref_should_resolve.rb +59 -0
  297. data/lib/chemicalml/convention/molecular/constraints/molecule_atom_array_mutually_exclusive_with_children.rb +1 -0
  298. data/lib/chemicalml/convention/molecular/constraints/molecule_bond_array_mutually_exclusive_with_children.rb +1 -0
  299. data/lib/chemicalml/convention/molecular/constraints/molecule_chirality_should_be_in_enum.rb +38 -0
  300. data/lib/chemicalml/convention/molecular/constraints/molecule_count_must_not_appear_on_top_level.rb +1 -0
  301. data/lib/chemicalml/convention/molecular/constraints/molecule_id_should_match_pattern.rb +38 -0
  302. data/lib/chemicalml/convention/molecular/constraints/molecule_must_have_id.rb +1 -1
  303. data/lib/chemicalml/convention/molecular/constraints/property_must_have_dict_ref.rb +1 -1
  304. data/lib/chemicalml/convention/molecular/constraints/property_scalar_data_type_matches_dictionary.rb +58 -0
  305. data/lib/chemicalml/convention/molecular/constraints/references_should_resolve.rb +37 -0
  306. data/lib/chemicalml/convention/molecular/constraints/scalar_must_have_data_type.rb +1 -1
  307. data/lib/chemicalml/convention/molecular/constraints.rb +49 -23
  308. data/lib/chemicalml/convention/molecular.rb +15 -2
  309. data/lib/chemicalml/convention/registry.rb +79 -11
  310. data/lib/chemicalml/convention/simple_unit/constraints/root_must_be_unit_list.rb +24 -0
  311. data/lib/chemicalml/convention/simple_unit/constraints/unit_must_have_power.rb +32 -0
  312. data/lib/chemicalml/convention/simple_unit/constraints/unit_must_have_symbol.rb +31 -0
  313. data/lib/chemicalml/convention/simple_unit/constraints.rb +16 -0
  314. data/lib/chemicalml/convention/simple_unit.rb +37 -0
  315. data/lib/chemicalml/convention/spectroscopy/constraints/peak_list_must_contain_peaks.rb +31 -0
  316. data/lib/chemicalml/convention/spectroscopy/constraints/peak_should_have_values.rb +34 -0
  317. data/lib/chemicalml/convention/spectroscopy/constraints/spectrum_must_have_content.rb +31 -0
  318. data/lib/chemicalml/convention/spectroscopy/constraints/spectrum_must_have_convention.rb +32 -0
  319. data/lib/chemicalml/convention/spectroscopy/constraints/spectrum_must_have_format.rb +31 -0
  320. data/lib/chemicalml/convention/spectroscopy/constraints.rb +20 -0
  321. data/lib/chemicalml/convention/spectroscopy.rb +41 -0
  322. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_list_must_contain_at_least_one_unit.rb +1 -0
  323. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_list_must_have_namespace.rb +1 -1
  324. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_contain_definition.rb +1 -0
  325. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_id.rb +1 -0
  326. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_multiplier_or_constant_to_si.rb +34 -0
  327. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_parent_si.rb +32 -0
  328. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_symbol_and_unit_type.rb +1 -1
  329. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_title.rb +32 -0
  330. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_parent_si_should_resolve.rb +45 -0
  331. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_unit_type_should_resolve.rb +46 -0
  332. data/lib/chemicalml/convention/unit_dictionary/constraints.rb +10 -0
  333. data/lib/chemicalml/convention/unit_dictionary.rb +7 -2
  334. data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_id_must_match_pattern.rb +1 -1
  335. data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_list_must_contain_at_least_one_unit_type.rb +1 -0
  336. data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_list_must_have_namespace.rb +1 -1
  337. data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_contain_definition.rb +1 -0
  338. data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_have_id_and_name.rb +1 -1
  339. data/lib/chemicalml/convention/unit_type_dictionary.rb +2 -2
  340. data/lib/chemicalml/convention/validation_report.rb +30 -3
  341. data/lib/chemicalml/convention/violation.rb +9 -3
  342. data/lib/chemicalml/convention.rb +41 -14
  343. data/lib/chemicalml/dictionary.rb +13 -9
  344. data/lib/chemicalml/logger.rb +47 -0
  345. data/lib/chemicalml/schema/definition.rb +2 -2
  346. data/lib/chemicalml/schema.rb +7 -7
  347. data/lib/chemicalml/version.rb +1 -1
  348. data/lib/chemicalml/versioned_parser.rb +10 -10
  349. data/lib/chemicalml.rb +78 -15
  350. data/lib/tasks/reference_fetch.rake +30 -31
  351. data/lib/tasks/scrape_fixtures.rake +23 -24
  352. metadata +118 -5
@@ -7,6 +7,7 @@ module Chemicalml
7
7
  def self.included(klass)
8
8
  klass.class_eval do
9
9
  include Chemicalml::Cml::Role::Abundance
10
+
10
11
  attribute :id, :string
11
12
  attribute :title, :string
12
13
  attribute :dict_ref, :string
@@ -17,14 +18,23 @@ module Chemicalml
17
18
  attribute :units, :string
18
19
  xml do
19
20
  namespace Chemicalml::Cml::Namespace
20
- root "abundance"
21
- map_attribute "id", to: :id
22
- map_attribute "title", to: :title
23
- map_attribute "dictRef", to: :dict_ref
24
- map_attribute "convention", to: :convention
25
- map_attribute "min", to: :min
26
- map_attribute "max", to: :max
27
- map_attribute "units", to: :units
21
+ root 'abundance'
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
+ map_attribute 'min', to: :min
27
+ map_attribute 'max', to: :max
28
+ map_attribute 'units', to: :units
29
+ end
30
+ key_value do
31
+ map 'id', to: :id
32
+ map 'title', to: :title
33
+ map 'dictRef', to: :dict_ref
34
+ map 'convention', to: :convention
35
+ map 'min', to: :min
36
+ map 'max', to: :max
37
+ map 'units', to: :units
28
38
  end
29
39
  end
30
40
  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::Action
10
+
10
11
  attribute :id, :string
11
12
  attribute :title, :string
12
13
  attribute :dict_ref, :string
@@ -25,22 +26,39 @@ module Chemicalml
25
26
  attribute :ref, :string
26
27
  xml do
27
28
  namespace Chemicalml::Cml::Namespace
28
- root "action"
29
- map_attribute "id", to: :id
30
- map_attribute "title", to: :title
31
- map_attribute "dictRef", to: :dict_ref
32
- map_attribute "convention", to: :convention
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
29
+ root 'action'
30
+ map_attribute 'id', to: :id
31
+ map_attribute 'title', to: :title
32
+ map_attribute 'dictRef', to: :dict_ref
33
+ map_attribute 'convention', to: :convention
34
+ map_attribute 'order', to: :order
35
+ map_attribute 'units', to: :units
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 'type', to: :type
42
+ map_attribute 'actionOrder', to: :action_order
43
+ map_attribute 'count', to: :count
44
+ map_attribute 'ref', to: :ref
45
+ end
46
+ key_value do
47
+ map 'id', to: :id
48
+ map 'title', to: :title
49
+ map 'dictRef', to: :dict_ref
50
+ map 'convention', to: :convention
51
+ map 'order', to: :order
52
+ map 'units', to: :units
53
+ map 'start', to: :start
54
+ map 'startCondition', to: :start_condition
55
+ map 'duration', to: :duration
56
+ map 'end', to: :end
57
+ map 'endCondition', to: :end_condition
58
+ map 'type', to: :type
59
+ map 'actionOrder', to: :action_order
60
+ map 'count', to: :count
61
+ map 'ref', to: :ref
44
62
  end
45
63
  end
46
64
  end
@@ -7,13 +7,14 @@ module Chemicalml
7
7
  def self.included(klass)
8
8
  klass.class_eval do
9
9
  include Chemicalml::Cml::Role::ActionList
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 :order, :string
15
16
 
16
- attribute :actions, :action, collection: true
17
+ attribute :actions, :action, collection: true
17
18
 
18
19
  attribute :start, :string
19
20
  attribute :start_condition, :string
@@ -26,22 +27,39 @@ module Chemicalml
26
27
  attribute :action_order, :string
27
28
  xml do
28
29
  namespace Chemicalml::Cml::Namespace
29
- map_element "action", to: :actions
30
- root "actionList"
31
- map_attribute "id", to: :id
32
- map_attribute "title", to: :title
33
- map_attribute "dictRef", to: :dict_ref
34
- map_attribute "convention", to: :convention
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
30
+ map_element 'action', to: :actions
31
+ root 'actionList'
32
+ map_attribute 'id', to: :id
33
+ map_attribute 'title', to: :title
34
+ map_attribute 'dictRef', to: :dict_ref
35
+ map_attribute 'convention', to: :convention
36
+ map_attribute 'order', to: :order
37
+ map_attribute 'start', to: :start
38
+ map_attribute 'startCondition', to: :start_condition
39
+ map_attribute 'duration', to: :duration
40
+ map_attribute 'end', to: :end
41
+ map_attribute 'endCondition', to: :end_condition
42
+ map_attribute 'units', to: :units
43
+ map_attribute 'count', to: :count
44
+ map_attribute 'type', to: :type
45
+ map_attribute 'actionOrder', to: :action_order
46
+ end
47
+ key_value do
48
+ map 'action', to: :actions
49
+ map 'id', to: :id
50
+ map 'title', to: :title
51
+ map 'dictRef', to: :dict_ref
52
+ map 'convention', to: :convention
53
+ map 'order', to: :order
54
+ map 'start', to: :start
55
+ map 'startCondition', to: :start_condition
56
+ map 'duration', to: :duration
57
+ map 'end', to: :end
58
+ map 'endCondition', to: :end_condition
59
+ map 'units', to: :units
60
+ map 'count', to: :count
61
+ map 'type', to: :type
62
+ map 'actionOrder', to: :action_order
45
63
  end
46
64
  end
47
65
  end
@@ -7,19 +7,28 @@ module Chemicalml
7
7
  def self.included(klass)
8
8
  klass.class_eval do
9
9
  include Chemicalml::Cml::Role::Alternative
10
+
10
11
  attribute :id, :string
11
12
  attribute :convention, :string
12
13
  attribute :alternative_type, :string
14
+ attribute :type, :string
13
15
  attribute :content, :string
14
16
 
15
17
  xml do
16
18
  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
19
+ root 'alternative'
20
+ map_attribute 'id', to: :id
21
+ map_attribute 'convention', to: :convention
22
+ map_attribute 'alternativeType', to: :alternative_type
23
+ map_attribute 'type', to: :type
21
24
  map_content to: :content
22
25
  end
26
+ key_value do
27
+ map 'id', to: :id
28
+ map 'convention', to: :convention
29
+ map 'alternativeType', to: :alternative_type
30
+ map 'type', to: :type
31
+ end
23
32
  end
24
33
  end
25
34
  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::Amount
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 :units, :string
16
17
  xml do
17
18
  namespace Chemicalml::Cml::Namespace
18
- root "amount"
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_attribute "units", to: :units
19
+ root 'amount'
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 'units', to: :units
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 'units', to: :units
24
32
  end
25
33
  end
26
34
  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::Angle
10
+
10
11
  attribute :id, :string
11
12
  attribute :title, :string
12
13
  attribute :dict_ref, :string
@@ -22,19 +23,33 @@ module Chemicalml
22
23
  attribute :ref, :string
23
24
  xml do
24
25
  namespace Chemicalml::Cml::Namespace
25
- root "angle"
26
- map_attribute "id", to: :id
27
- map_attribute "title", to: :title
28
- map_attribute "dictRef", to: :dict_ref
29
- map_attribute "convention", to: :convention
30
- map_attribute "atomRefs3", to: :atomRefs3
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
+ root 'angle'
27
+ map_attribute 'id', to: :id
28
+ map_attribute 'title', to: :title
29
+ map_attribute 'dictRef', to: :dict_ref
30
+ map_attribute 'convention', to: :convention
31
+ map_attribute 'atomRefs3', to: :atomRefs3
32
+ map_attribute 'units', to: :units
33
+ map_attribute 'angleUnits', to: :angle_units
34
+ map_attribute 'errorValue', to: :error_value
35
+ map_attribute 'errorBasis', to: :error_basis
36
+ map_attribute 'min', to: :min
37
+ map_attribute 'max', to: :max
38
+ map_attribute 'ref', to: :ref
39
+ end
40
+ key_value do
41
+ map 'id', to: :id
42
+ map 'title', to: :title
43
+ map 'dictRef', to: :dict_ref
44
+ map 'convention', to: :convention
45
+ map 'atomRefs3', to: :atomRefs3
46
+ map 'units', to: :units
47
+ map 'angleUnits', to: :angle_units
48
+ map 'errorValue', to: :error_value
49
+ map 'errorBasis', to: :error_basis
50
+ map 'min', to: :min
51
+ map 'max', to: :max
52
+ map 'ref', to: :ref
38
53
  end
39
54
  end
40
55
  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::Annotation
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
 
16
17
  xml do
17
18
  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
19
+ root 'annotation'
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_element 'documentation', to: :documentation
25
+ end
26
+ key_value do
27
+ map 'documentation', to: :documentation
28
+ map 'id', to: :id
29
+ map 'title', to: :title
30
+ map 'dictRef', to: :dict_ref
31
+ map 'convention', to: :convention
24
32
  end
25
33
  end
26
34
  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::AnyCml
10
+
10
11
  attribute :id, :string
11
12
  attribute :title, :string
12
13
  attribute :dict_ref, :string
@@ -14,11 +15,17 @@ module Chemicalml
14
15
 
15
16
  xml do
16
17
  namespace Chemicalml::Cml::Namespace
17
- root "anyCml"
18
- map_attribute "id", to: :id
19
- map_attribute "title", to: :title
20
- map_attribute "dictRef", to: :dict_ref
21
- map_attribute "convention", to: :convention
18
+ root 'anyCml'
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
+ end
24
+ key_value do
25
+ map 'id', to: :id
26
+ map 'title', to: :title
27
+ map 'dictRef', to: :dict_ref
28
+ map 'convention', to: :convention
22
29
  end
23
30
  end
24
31
  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::Appinfo
10
+
10
11
  attribute :id, :string
11
12
  attribute :title, :string
12
13
  attribute :dict_ref, :string
@@ -16,13 +17,20 @@ module Chemicalml
16
17
  attribute :role, :string
17
18
  xml do
18
19
  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
20
+ root 'appinfo'
21
+ map_attribute 'id', to: :id
22
+ map_attribute 'title', to: :title
23
+ map_attribute 'dictRef', to: :dict_ref
24
+ map_attribute 'convention', to: :convention
24
25
  map_content to: :content
25
- map_attribute "role", to: :role
26
+ map_attribute 'role', to: :role
27
+ end
28
+ key_value do
29
+ map 'id', to: :id
30
+ map 'title', to: :title
31
+ map 'dictRef', to: :dict_ref
32
+ map 'convention', to: :convention
33
+ map 'role', to: :role
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::Arg
10
+
10
11
  attribute :title, :string
11
12
  attribute :id, :string
12
13
  attribute :convention, :string
@@ -21,22 +22,55 @@ module Chemicalml
21
22
  attribute :eval, :string
22
23
  attribute :content, :string
23
24
 
25
+ attribute :atom, :atom
26
+ attribute :atom_type, :atomType
27
+ attribute :expression, :expression
28
+ attribute :arrays, :array, collection: true
29
+ attribute :matrices, :matrix, collection: true
30
+ attribute :scalars, :scalar, collection: true
31
+
24
32
  xml do
25
33
  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
34
+ root 'arg'
35
+ map_attribute 'title', to: :title
36
+ map_attribute 'id', to: :id
37
+ map_attribute 'convention', to: :convention
38
+ map_attribute 'dictRef', to: :dict_ref
39
+ map_attribute 'ref', to: :ref
40
+ map_attribute 'name', to: :name
41
+ map_attribute 'dataType', to: :data_type
42
+ map_attribute 'substitute', to: :substitute
43
+ map_attribute 'parameterName', to: :parameter_name
44
+ map_attribute 'parentAttribute', to: :parent_attribute
45
+ map_attribute 'delete', to: :delete
46
+ map_attribute 'eval', to: :eval
39
47
  map_content to: :content
48
+ map_element 'atom', to: :atom
49
+ map_element 'atomType', to: :atom_type
50
+ map_element 'expression', to: :expression
51
+ map_element 'array', to: :arrays
52
+ map_element 'matrix', to: :matrices
53
+ map_element 'scalar', to: :scalars
54
+ end
55
+ key_value do
56
+ map 'atom', to: :atom
57
+ map 'atomType', to: :atom_type
58
+ map 'expression', to: :expression
59
+ map 'array', to: :arrays
60
+ map 'matrix', to: :matrices
61
+ map 'scalar', to: :scalars
62
+ map 'title', to: :title
63
+ map 'id', to: :id
64
+ map 'convention', to: :convention
65
+ map 'dictRef', to: :dict_ref
66
+ map 'ref', to: :ref
67
+ map 'name', to: :name
68
+ map 'dataType', to: :data_type
69
+ map 'substitute', to: :substitute
70
+ map 'parameterName', to: :parameter_name
71
+ map 'parentAttribute', to: :parent_attribute
72
+ map 'delete', to: :delete
73
+ map 'eval', to: :eval
40
74
  end
41
75
  end
42
76
  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::Array
10
+
10
11
  attribute :id, :string
11
12
  attribute :title, :string
12
13
  attribute :dict_ref, :string
@@ -29,26 +30,46 @@ module Chemicalml
29
30
  attribute :unit_type, :string
30
31
  xml do
31
32
  namespace Chemicalml::Cml::Namespace
32
- root "array"
33
- map_attribute "id", to: :id
34
- map_attribute "title", to: :title
35
- map_attribute "dictRef", to: :dict_ref
36
- map_attribute "dataType", to: :data_type
37
- map_attribute "units", to: :units
38
- map_attribute "size", to: :size
39
- map_attribute "delimiter", to: :delimiter
33
+ root 'array'
34
+ map_attribute 'id', to: :id
35
+ map_attribute 'title', to: :title
36
+ map_attribute 'dictRef', to: :dict_ref
37
+ map_attribute 'dataType', to: :data_type
38
+ map_attribute 'units', to: :units
39
+ map_attribute 'size', to: :size
40
+ map_attribute 'delimiter', to: :delimiter
40
41
  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
42
+ map_attribute 'convention', to: :convention
43
+ map_attribute 'errorValueArray', to: :error_value_array
44
+ map_attribute 'errorBasis', to: :error_basis
45
+ map_attribute 'minValueArray', to: :min_value_array
46
+ map_attribute 'maxValueArray', to: :max_value_array
47
+ map_attribute 'start', to: :start
48
+ map_attribute 'end', to: :end
49
+ map_attribute 'ref', to: :ref
50
+ map_attribute 'constantToSI', to: :constant_to_s_i
51
+ map_attribute 'multiplierToSI', to: :multiplier_to_s_i
52
+ map_attribute 'unitType', to: :unit_type
53
+ end
54
+ key_value do
55
+ map 'id', to: :id
56
+ map 'title', to: :title
57
+ map 'dictRef', to: :dict_ref
58
+ map 'dataType', to: :data_type
59
+ map 'units', to: :units
60
+ map 'size', to: :size
61
+ map 'delimiter', to: :delimiter
62
+ map 'convention', to: :convention
63
+ map 'errorValueArray', to: :error_value_array
64
+ map 'errorBasis', to: :error_basis
65
+ map 'minValueArray', to: :min_value_array
66
+ map 'maxValueArray', to: :max_value_array
67
+ map 'start', to: :start
68
+ map 'end', to: :end
69
+ map 'ref', to: :ref
70
+ map 'constantToSI', to: :constant_to_s_i
71
+ map 'multiplierToSI', to: :multiplier_to_s_i
72
+ map 'unitType', to: :unit_type
52
73
  end
53
74
  end
54
75
  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::ArrayList
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 :shape, :string
16
17
  xml do
17
18
  namespace Chemicalml::Cml::Namespace
18
- root "arrayList"
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_attribute "shape", to: :shape
19
+ root 'arrayList'
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 'shape', to: :shape
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 'shape', to: :shape
24
32
  end
25
33
  end
26
34
  end