chemicalml 0.1.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 +7 -0
- data/.gitignore +11 -0
- data/.rubocop.yml +20 -0
- data/CHANGELOG.md +21 -0
- data/CLAUDE.md +198 -0
- data/Gemfile +14 -0
- data/LICENSE +24 -0
- data/NOTICES.adoc +115 -0
- data/README.adoc +87 -0
- data/Rakefile +8 -0
- data/TODO.align/01-cml-base-mixins.md +122 -0
- data/TODO.align/02-real-schema-hierarchies.md +88 -0
- data/TODO.align/03-configuration.md +50 -0
- data/TODO.align/04-parse-entry-points.md +59 -0
- data/TODO.align/05-schema-aware-translator.md +33 -0
- data/TODO.align/06-no-respond-to.md +44 -0
- data/TODO.align/07-canon-xml-comparison.md +43 -0
- data/TODO.align/08-expand-fixtures.md +37 -0
- data/TODO.align/09-final-spec-lint.md +29 -0
- data/TODO.align/10-role-marker-modules.md +54 -0
- data/TODO.align/11-dry-configuration.md +63 -0
- data/TODO.align/12-wire-class-macro.md +51 -0
- data/TODO.align/13-wire-namespace.md +44 -0
- data/TODO.align/14-schema24-correctness.md +37 -0
- data/TODO.align/15-canon-fixture-roundtrip.md +38 -0
- data/TODO.align/16-schema24-convention-coverage.md +33 -0
- data/TODO.align/17-final-spec-lint.md +28 -0
- data/TODO.align/README.md +27 -0
- data/TODO.align/README.round2.md +24 -0
- data/TODO.cml-full/01-reference-docs.md +43 -0
- data/TODO.cml-full/02-schema-versioned-model.md +70 -0
- data/TODO.cml-full/03-fixtures-scrape.md +52 -0
- data/TODO.cml-full/04-convention-framework.md +69 -0
- data/TODO.cml-full/05-dictionary-layer.md +77 -0
- data/TODO.cml-full/06-extend-canonical-translator.md +60 -0
- data/TODO.cml-full/07-attribution-notices.md +42 -0
- data/TODO.cml-full/08-autoload-only.md +48 -0
- data/TODO.cml-full/09-spec-coverage.md +38 -0
- data/TODO.cml-full/README.md +23 -0
- data/chemicalml.gemspec +35 -0
- data/data/dictionaries/_index.yaml +14 -0
- data/data/dictionaries/compchem.yaml +481 -0
- data/data/dictionaries/unit_non_si.yaml +53 -0
- data/data/dictionaries/unit_si.yaml +87 -0
- data/data/dictionaries/unit_type.yaml +113 -0
- data/lib/chemicalml/cml/array.rb +10 -0
- data/lib/chemicalml/cml/atom.rb +10 -0
- data/lib/chemicalml/cml/atom_array.rb +10 -0
- data/lib/chemicalml/cml/atom_parity.rb +10 -0
- data/lib/chemicalml/cml/base/array.rb +36 -0
- data/lib/chemicalml/cml/base/atom.rb +38 -0
- data/lib/chemicalml/cml/base/atom_array.rb +22 -0
- data/lib/chemicalml/cml/base/atom_parity.rb +24 -0
- data/lib/chemicalml/cml/base/bond.rb +28 -0
- data/lib/chemicalml/cml/base/bond_array.rb +22 -0
- data/lib/chemicalml/cml/base/bond_stereo.rb +28 -0
- data/lib/chemicalml/cml/base/cml_module.rb +40 -0
- data/lib/chemicalml/cml/base/dictionary.rb +32 -0
- data/lib/chemicalml/cml/base/dictionary_entry.rb +34 -0
- data/lib/chemicalml/cml/base/document.rb +26 -0
- data/lib/chemicalml/cml/base/formula.rb +38 -0
- data/lib/chemicalml/cml/base/identifier.rb +26 -0
- data/lib/chemicalml/cml/base/label.rb +28 -0
- data/lib/chemicalml/cml/base/list.rb +36 -0
- data/lib/chemicalml/cml/base/matrix.rb +38 -0
- data/lib/chemicalml/cml/base/metadata.rb +30 -0
- data/lib/chemicalml/cml/base/metadata_list.rb +28 -0
- data/lib/chemicalml/cml/base/molecule.rb +40 -0
- data/lib/chemicalml/cml/base/name.rb +26 -0
- data/lib/chemicalml/cml/base/parameter.rb +34 -0
- data/lib/chemicalml/cml/base/parameter_list.rb +28 -0
- data/lib/chemicalml/cml/base/product.rb +22 -0
- data/lib/chemicalml/cml/base/product_list.rb +22 -0
- data/lib/chemicalml/cml/base/property.rb +34 -0
- data/lib/chemicalml/cml/base/property_list.rb +28 -0
- data/lib/chemicalml/cml/base/reactant.rb +22 -0
- data/lib/chemicalml/cml/base/reactant_list.rb +22 -0
- data/lib/chemicalml/cml/base/reaction.rb +32 -0
- data/lib/chemicalml/cml/base/reaction_list.rb +22 -0
- data/lib/chemicalml/cml/base/scalar.rb +32 -0
- data/lib/chemicalml/cml/base/substance.rb +30 -0
- data/lib/chemicalml/cml/base/unit.rb +38 -0
- data/lib/chemicalml/cml/base/unit_list.rb +30 -0
- data/lib/chemicalml/cml/base/unit_type.rb +28 -0
- data/lib/chemicalml/cml/base/unit_type_list.rb +30 -0
- data/lib/chemicalml/cml/base.rb +51 -0
- data/lib/chemicalml/cml/bond.rb +10 -0
- data/lib/chemicalml/cml/bond_array.rb +10 -0
- data/lib/chemicalml/cml/bond_stereo.rb +10 -0
- data/lib/chemicalml/cml/cml_module.rb +10 -0
- data/lib/chemicalml/cml/dictionary.rb +10 -0
- data/lib/chemicalml/cml/dictionary_entry.rb +10 -0
- data/lib/chemicalml/cml/document.rb +10 -0
- data/lib/chemicalml/cml/elements.rb +58 -0
- data/lib/chemicalml/cml/formula.rb +10 -0
- data/lib/chemicalml/cml/identifier.rb +10 -0
- data/lib/chemicalml/cml/label.rb +10 -0
- data/lib/chemicalml/cml/list.rb +10 -0
- data/lib/chemicalml/cml/matrix.rb +10 -0
- data/lib/chemicalml/cml/metadata.rb +10 -0
- data/lib/chemicalml/cml/metadata_list.rb +10 -0
- data/lib/chemicalml/cml/molecule.rb +10 -0
- data/lib/chemicalml/cml/name.rb +10 -0
- data/lib/chemicalml/cml/namespace.rb +17 -0
- data/lib/chemicalml/cml/parameter.rb +10 -0
- data/lib/chemicalml/cml/parameter_list.rb +10 -0
- data/lib/chemicalml/cml/product.rb +10 -0
- data/lib/chemicalml/cml/product_list.rb +10 -0
- data/lib/chemicalml/cml/property.rb +10 -0
- data/lib/chemicalml/cml/property_list.rb +10 -0
- data/lib/chemicalml/cml/reactant.rb +10 -0
- data/lib/chemicalml/cml/reactant_list.rb +10 -0
- data/lib/chemicalml/cml/reaction.rb +10 -0
- data/lib/chemicalml/cml/reaction_list.rb +10 -0
- data/lib/chemicalml/cml/role/array.rb +13 -0
- data/lib/chemicalml/cml/role/atom.rb +13 -0
- data/lib/chemicalml/cml/role/atom_array.rb +13 -0
- data/lib/chemicalml/cml/role/atom_parity.rb +13 -0
- data/lib/chemicalml/cml/role/bond.rb +13 -0
- data/lib/chemicalml/cml/role/bond_array.rb +13 -0
- data/lib/chemicalml/cml/role/bond_stereo.rb +13 -0
- data/lib/chemicalml/cml/role/cml_module.rb +14 -0
- data/lib/chemicalml/cml/role/dictionary.rb +13 -0
- data/lib/chemicalml/cml/role/dictionary_entry.rb +13 -0
- data/lib/chemicalml/cml/role/document.rb +13 -0
- data/lib/chemicalml/cml/role/formula.rb +13 -0
- data/lib/chemicalml/cml/role/identifier.rb +13 -0
- data/lib/chemicalml/cml/role/label.rb +13 -0
- data/lib/chemicalml/cml/role/list.rb +13 -0
- data/lib/chemicalml/cml/role/matrix.rb +13 -0
- data/lib/chemicalml/cml/role/metadata.rb +13 -0
- data/lib/chemicalml/cml/role/metadata_list.rb +13 -0
- data/lib/chemicalml/cml/role/molecule.rb +13 -0
- data/lib/chemicalml/cml/role/name.rb +13 -0
- data/lib/chemicalml/cml/role/parameter.rb +13 -0
- data/lib/chemicalml/cml/role/parameter_list.rb +13 -0
- data/lib/chemicalml/cml/role/product.rb +13 -0
- data/lib/chemicalml/cml/role/product_list.rb +13 -0
- data/lib/chemicalml/cml/role/property.rb +13 -0
- data/lib/chemicalml/cml/role/property_list.rb +13 -0
- data/lib/chemicalml/cml/role/reactant.rb +13 -0
- data/lib/chemicalml/cml/role/reactant_list.rb +13 -0
- data/lib/chemicalml/cml/role/reaction.rb +13 -0
- data/lib/chemicalml/cml/role/reaction_list.rb +13 -0
- data/lib/chemicalml/cml/role/scalar.rb +13 -0
- data/lib/chemicalml/cml/role/substance.rb +13 -0
- data/lib/chemicalml/cml/role/unit.rb +13 -0
- data/lib/chemicalml/cml/role/unit_list.rb +13 -0
- data/lib/chemicalml/cml/role/unit_type.rb +13 -0
- data/lib/chemicalml/cml/role/unit_type_list.rb +13 -0
- data/lib/chemicalml/cml/role.rb +54 -0
- data/lib/chemicalml/cml/scalar.rb +10 -0
- data/lib/chemicalml/cml/schema24/configuration.rb +19 -0
- data/lib/chemicalml/cml/schema24.rb +40 -0
- data/lib/chemicalml/cml/schema3/configuration.rb +17 -0
- data/lib/chemicalml/cml/schema3.rb +40 -0
- data/lib/chemicalml/cml/substance.rb +10 -0
- data/lib/chemicalml/cml/translator/value_translations.rb +265 -0
- data/lib/chemicalml/cml/translator.rb +233 -0
- data/lib/chemicalml/cml/unit.rb +10 -0
- data/lib/chemicalml/cml/unit_list.rb +10 -0
- data/lib/chemicalml/cml/unit_type.rb +10 -0
- data/lib/chemicalml/cml/unit_type_list.rb +10 -0
- data/lib/chemicalml/cml/visitable.rb +65 -0
- data/lib/chemicalml/cml/wire_class_macro.rb +45 -0
- data/lib/chemicalml/cml.rb +55 -0
- data/lib/chemicalml/context_configuration.rb +127 -0
- data/lib/chemicalml/convention/base.rb +48 -0
- data/lib/chemicalml/convention/compchem/constraints/compchem_module_must_contain_job_list.rb +33 -0
- data/lib/chemicalml/convention/compchem/constraints/job_must_contain_initialization.rb +38 -0
- data/lib/chemicalml/convention/compchem/constraints.rb +14 -0
- data/lib/chemicalml/convention/compchem.rb +28 -0
- data/lib/chemicalml/convention/constraint.rb +79 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_ids_unique_within_dictionary.rb +33 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_id_and_term.rb +34 -0
- data/lib/chemicalml/convention/dictionary/constraints.rb +14 -0
- data/lib/chemicalml/convention/dictionary.rb +28 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_array_must_contain_atoms.rb +30 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_ids_unique_within_molecule.rb +42 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_must_reference_atoms_in_same_molecule.rb +54 -0
- data/lib/chemicalml/convention/molecular/constraints.rb +19 -0
- data/lib/chemicalml/convention/molecular.rb +29 -0
- data/lib/chemicalml/convention/registry.rb +50 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_symbol_and_unit_type.rb +46 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints.rb +12 -0
- data/lib/chemicalml/convention/unit_dictionary.rb +27 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_have_id_and_name.rb +34 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints.rb +12 -0
- data/lib/chemicalml/convention/unit_type_dictionary.rb +27 -0
- data/lib/chemicalml/convention/violation.rb +36 -0
- data/lib/chemicalml/convention.rb +39 -0
- data/lib/chemicalml/dictionary/entry.rb +59 -0
- data/lib/chemicalml/dictionary/enum.rb +51 -0
- data/lib/chemicalml/dictionary/link.rb +32 -0
- data/lib/chemicalml/dictionary/loader.rb +60 -0
- data/lib/chemicalml/dictionary/model.rb +64 -0
- data/lib/chemicalml/dictionary/registry.rb +75 -0
- data/lib/chemicalml/dictionary.rb +26 -0
- data/lib/chemicalml/errors.rb +7 -0
- data/lib/chemicalml/model/atom.rb +40 -0
- data/lib/chemicalml/model/bond.rb +33 -0
- data/lib/chemicalml/model/cml_array.rb +27 -0
- data/lib/chemicalml/model/cml_module.rb +45 -0
- data/lib/chemicalml/model/document.rb +29 -0
- data/lib/chemicalml/model/formula.rb +34 -0
- data/lib/chemicalml/model/identifier.rb +21 -0
- data/lib/chemicalml/model/label.rb +21 -0
- data/lib/chemicalml/model/matrix.rb +29 -0
- data/lib/chemicalml/model/metadata.rb +23 -0
- data/lib/chemicalml/model/metadata_list.rb +25 -0
- data/lib/chemicalml/model/molecule.rb +38 -0
- data/lib/chemicalml/model/name.rb +21 -0
- data/lib/chemicalml/model/node.rb +45 -0
- data/lib/chemicalml/model/parameter.rb +27 -0
- data/lib/chemicalml/model/parameter_list.rb +25 -0
- data/lib/chemicalml/model/product.rb +21 -0
- data/lib/chemicalml/model/product_list.rb +21 -0
- data/lib/chemicalml/model/property.rb +28 -0
- data/lib/chemicalml/model/property_list.rb +25 -0
- data/lib/chemicalml/model/reactant.rb +21 -0
- data/lib/chemicalml/model/reactant_list.rb +21 -0
- data/lib/chemicalml/model/reaction.rb +41 -0
- data/lib/chemicalml/model/reaction_list.rb +23 -0
- data/lib/chemicalml/model/scalar.rb +25 -0
- data/lib/chemicalml/model/substance.rb +25 -0
- data/lib/chemicalml/model.rb +38 -0
- data/lib/chemicalml/schema/definition.rb +41 -0
- data/lib/chemicalml/schema/registry.rb +30 -0
- data/lib/chemicalml/schema.rb +35 -0
- data/lib/chemicalml/version.rb +5 -0
- data/lib/chemicalml/versioned_parser.rb +43 -0
- data/lib/chemicalml.rb +47 -0
- data/lib/tasks/reference_fetch.rake +105 -0
- data/lib/tasks/scrape_fixtures.rake +133 -0
- data/reference-docs/conventions/compchem.md +141 -0
- data/reference-docs/conventions/dictionary.md +119 -0
- data/reference-docs/conventions/index.md +56 -0
- data/reference-docs/conventions/molecular.md +115 -0
- data/reference-docs/conventions/unit-dictionary.md +92 -0
- data/reference-docs/conventions/unitType-dictionary.md +51 -0
- data/reference-docs/dictionaries/compchem.md +335 -0
- data/reference-docs/dictionaries/index.md +52 -0
- data/reference-docs/examples/schema24-index.md +50 -0
- data/reference-docs/examples/schema3-compchem-index.md +14 -0
- data/reference-docs/examples/schema3-molecular-index.md +28 -0
- data/reference-docs/schemas/schema24/schema.xsd +10624 -0
- data/reference-docs/schemas/schema3/schema.xsd +11459 -0
- metadata +306 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Metadata
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Metadata
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :name, :string
|
|
12
|
+
attribute :content, :string
|
|
13
|
+
attribute :convention, :string
|
|
14
|
+
attribute :title, :string
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
namespace Chemicalml::Cml::Namespace
|
|
18
|
+
root "metadata"
|
|
19
|
+
map_attribute "id", to: :id
|
|
20
|
+
map_attribute "name", to: :name
|
|
21
|
+
map_attribute "content", to: :content
|
|
22
|
+
map_attribute "convention", to: :convention
|
|
23
|
+
map_attribute "title", to: :title
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module MetadataList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::MetadataList
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :metadata, :metadata, collection: true
|
|
14
|
+
|
|
15
|
+
xml do
|
|
16
|
+
namespace Chemicalml::Cml::Namespace
|
|
17
|
+
root "metadataList"
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "title", to: :title
|
|
20
|
+
map_attribute "dictRef", to: :dict_ref
|
|
21
|
+
map_element "metadata", to: :metadata
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Molecule
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Molecule
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :count, :string
|
|
13
|
+
attribute :formal_charge, :string
|
|
14
|
+
attribute :spin_multiplicity, :string
|
|
15
|
+
attribute :names, :name, collection: true
|
|
16
|
+
attribute :identifiers, :identifier, collection: true
|
|
17
|
+
attribute :atom_array, :atomArray
|
|
18
|
+
attribute :bond_array, :bondArray
|
|
19
|
+
attribute :molecules, :molecule, collection: true
|
|
20
|
+
|
|
21
|
+
xml do
|
|
22
|
+
namespace Chemicalml::Cml::Namespace
|
|
23
|
+
root "molecule"
|
|
24
|
+
map_attribute "id", to: :id
|
|
25
|
+
map_attribute "title", to: :title
|
|
26
|
+
map_attribute "count", to: :count
|
|
27
|
+
map_attribute "formalCharge", to: :formal_charge
|
|
28
|
+
map_attribute "spinMultiplicity", to: :spin_multiplicity
|
|
29
|
+
map_element "name", to: :names
|
|
30
|
+
map_element "identifier", to: :identifiers
|
|
31
|
+
map_element "atomArray", to: :atom_array
|
|
32
|
+
map_element "bondArray", to: :bond_array
|
|
33
|
+
map_element "molecule", to: :molecules
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Name
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Name
|
|
10
|
+
attribute :content, :string
|
|
11
|
+
attribute :convention, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
namespace Chemicalml::Cml::Namespace
|
|
16
|
+
root "name"
|
|
17
|
+
map_content to: :content
|
|
18
|
+
map_attribute "convention", to: :convention
|
|
19
|
+
map_attribute "dictRef", to: :dict_ref
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Parameter
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Parameter
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :convention, :string
|
|
14
|
+
attribute :scalar, :scalar
|
|
15
|
+
attribute :array, :array
|
|
16
|
+
attribute :matrix, :matrix
|
|
17
|
+
|
|
18
|
+
xml do
|
|
19
|
+
namespace Chemicalml::Cml::Namespace
|
|
20
|
+
root "parameter"
|
|
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_element "scalar", to: :scalar
|
|
26
|
+
map_element "array", to: :array
|
|
27
|
+
map_element "matrix", to: :matrix
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module ParameterList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::ParameterList
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :parameters, :parameter, collection: true
|
|
14
|
+
|
|
15
|
+
xml do
|
|
16
|
+
namespace Chemicalml::Cml::Namespace
|
|
17
|
+
root "parameterList"
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "title", to: :title
|
|
20
|
+
map_attribute "dictRef", to: :dict_ref
|
|
21
|
+
map_element "parameter", to: :parameters
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Product
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Product
|
|
10
|
+
attribute :substance, :substance
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
namespace Chemicalml::Cml::Namespace
|
|
14
|
+
root "product"
|
|
15
|
+
map_element "substance", to: :substance
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module ProductList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::ProductList
|
|
10
|
+
attribute :products, :product, collection: true
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
namespace Chemicalml::Cml::Namespace
|
|
14
|
+
root "productList"
|
|
15
|
+
map_element "product", to: :products
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Property
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Property
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :convention, :string
|
|
14
|
+
attribute :scalar, :scalar
|
|
15
|
+
attribute :array, :array
|
|
16
|
+
attribute :matrix, :matrix
|
|
17
|
+
|
|
18
|
+
xml do
|
|
19
|
+
namespace Chemicalml::Cml::Namespace
|
|
20
|
+
root "property"
|
|
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_element "scalar", to: :scalar
|
|
26
|
+
map_element "array", to: :array
|
|
27
|
+
map_element "matrix", to: :matrix
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module PropertyList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::PropertyList
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :properties, :property, collection: true
|
|
14
|
+
|
|
15
|
+
xml do
|
|
16
|
+
namespace Chemicalml::Cml::Namespace
|
|
17
|
+
root "propertyList"
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "title", to: :title
|
|
20
|
+
map_attribute "dictRef", to: :dict_ref
|
|
21
|
+
map_element "property", to: :properties
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Reactant
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Reactant
|
|
10
|
+
attribute :substance, :substance
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
namespace Chemicalml::Cml::Namespace
|
|
14
|
+
root "reactant"
|
|
15
|
+
map_element "substance", to: :substance
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module ReactantList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::ReactantList
|
|
10
|
+
attribute :reactants, :reactant, collection: true
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
namespace Chemicalml::Cml::Namespace
|
|
14
|
+
root "reactantList"
|
|
15
|
+
map_element "reactant", to: :reactants
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Reaction
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Reaction
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :type, :string
|
|
13
|
+
attribute :state, :string
|
|
14
|
+
attribute :reactant_list, :reactantList
|
|
15
|
+
attribute :product_list, :productList
|
|
16
|
+
|
|
17
|
+
xml do
|
|
18
|
+
namespace Chemicalml::Cml::Namespace
|
|
19
|
+
root "reaction"
|
|
20
|
+
map_attribute "id", to: :id
|
|
21
|
+
map_attribute "title", to: :title
|
|
22
|
+
map_attribute "type", to: :type
|
|
23
|
+
map_attribute "state", to: :state
|
|
24
|
+
map_element "reactantList", to: :reactant_list
|
|
25
|
+
map_element "productList", to: :product_list
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module ReactionList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::ReactionList
|
|
10
|
+
attribute :reactions, :reaction, collection: true
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
namespace Chemicalml::Cml::Namespace
|
|
14
|
+
root "reactionList"
|
|
15
|
+
map_element "reaction", to: :reactions
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Scalar
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Scalar
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :data_type, :string
|
|
14
|
+
attribute :units, :string
|
|
15
|
+
attribute :content, :string
|
|
16
|
+
|
|
17
|
+
xml do
|
|
18
|
+
namespace Chemicalml::Cml::Namespace
|
|
19
|
+
root "scalar"
|
|
20
|
+
map_attribute "id", to: :id
|
|
21
|
+
map_attribute "title", to: :title
|
|
22
|
+
map_attribute "dictRef", to: :dict_ref
|
|
23
|
+
map_attribute "dataType", to: :data_type
|
|
24
|
+
map_attribute "units", to: :units
|
|
25
|
+
map_content to: :content
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Substance
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Substance
|
|
10
|
+
attribute :title, :string
|
|
11
|
+
attribute :role, :string
|
|
12
|
+
attribute :molecule, :molecule
|
|
13
|
+
attribute :names, :name, collection: true
|
|
14
|
+
attribute :identifiers, :identifier, collection: true
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
namespace Chemicalml::Cml::Namespace
|
|
18
|
+
root "substance"
|
|
19
|
+
map_attribute "title", to: :title
|
|
20
|
+
map_attribute "role", to: :role
|
|
21
|
+
map_element "molecule", to: :molecule
|
|
22
|
+
map_element "name", to: :names
|
|
23
|
+
map_element "identifier", to: :identifiers
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Unit
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Unit
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :symbol, :string
|
|
13
|
+
attribute :parent_si, :string
|
|
14
|
+
attribute :multiplier_to_si, :string
|
|
15
|
+
attribute :constant_to_si, :string
|
|
16
|
+
attribute :unit_type, :string
|
|
17
|
+
attribute :definition, :string
|
|
18
|
+
attribute :description, :string
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
namespace Chemicalml::Cml::Namespace
|
|
22
|
+
root "unit"
|
|
23
|
+
map_attribute "id", to: :id
|
|
24
|
+
map_attribute "title", to: :title
|
|
25
|
+
map_attribute "symbol", to: :symbol
|
|
26
|
+
map_attribute "parentSI", to: :parent_si
|
|
27
|
+
map_attribute "multiplierToSI", to: :multiplier_to_si
|
|
28
|
+
map_attribute "constantToSI", to: :constant_to_si
|
|
29
|
+
map_attribute "unitType", to: :unit_type
|
|
30
|
+
map_element "definition", to: :definition
|
|
31
|
+
map_element "description", to: :description
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module UnitList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::UnitList
|
|
10
|
+
attribute :title, :string
|
|
11
|
+
attribute :namespace, :string
|
|
12
|
+
attribute :convention, :string
|
|
13
|
+
attribute :description, :string
|
|
14
|
+
attribute :units, :unit, collection: true
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
namespace Chemicalml::Cml::Namespace
|
|
18
|
+
root "unitList"
|
|
19
|
+
map_attribute "title", to: :title
|
|
20
|
+
map_attribute "namespace", to: :namespace
|
|
21
|
+
map_attribute "convention", to: :convention
|
|
22
|
+
map_element "description", to: :description
|
|
23
|
+
map_element "unit", to: :units
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module UnitType
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::UnitType
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :name, :string
|
|
12
|
+
attribute :definition, :string
|
|
13
|
+
attribute :description, :string
|
|
14
|
+
|
|
15
|
+
xml do
|
|
16
|
+
namespace Chemicalml::Cml::Namespace
|
|
17
|
+
root "unitType"
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "name", to: :name
|
|
20
|
+
map_element "definition", to: :definition
|
|
21
|
+
map_element "description", to: :description
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module UnitTypeList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::UnitTypeList
|
|
10
|
+
attribute :title, :string
|
|
11
|
+
attribute :namespace, :string
|
|
12
|
+
attribute :convention, :string
|
|
13
|
+
attribute :description, :string
|
|
14
|
+
attribute :unit_types, :unitType, collection: true
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
namespace Chemicalml::Cml::Namespace
|
|
18
|
+
root "unitTypeList"
|
|
19
|
+
map_attribute "title", to: :title
|
|
20
|
+
map_attribute "namespace", to: :namespace
|
|
21
|
+
map_attribute "convention", to: :convention
|
|
22
|
+
map_element "description", to: :description
|
|
23
|
+
map_element "unitType", to: :unit_types
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
# Shared attribute + xml-mapping declarations for every CML element.
|
|
6
|
+
#
|
|
7
|
+
# Each module here is mixed into the corresponding `Schema3::*` and
|
|
8
|
+
# `Schema24::*` wire class. Schema-version-specific deviations live
|
|
9
|
+
# in `Base::Schema3Only::*` / `Base::Schema24Only::*` and are
|
|
10
|
+
# included only by the relevant version's classes — keeping the
|
|
11
|
+
# shared declarations open for extension, closed for modification.
|
|
12
|
+
module Base
|
|
13
|
+
autoload :Array, "chemicalml/cml/base/array"
|
|
14
|
+
autoload :Atom, "chemicalml/cml/base/atom"
|
|
15
|
+
autoload :AtomArray, "chemicalml/cml/base/atom_array"
|
|
16
|
+
autoload :AtomParity, "chemicalml/cml/base/atom_parity"
|
|
17
|
+
autoload :Bond, "chemicalml/cml/base/bond"
|
|
18
|
+
autoload :BondArray, "chemicalml/cml/base/bond_array"
|
|
19
|
+
autoload :BondStereo, "chemicalml/cml/base/bond_stereo"
|
|
20
|
+
autoload :Dictionary, "chemicalml/cml/base/dictionary"
|
|
21
|
+
autoload :DictionaryEntry, "chemicalml/cml/base/dictionary_entry"
|
|
22
|
+
autoload :Document, "chemicalml/cml/base/document"
|
|
23
|
+
autoload :Formula, "chemicalml/cml/base/formula"
|
|
24
|
+
autoload :Identifier, "chemicalml/cml/base/identifier"
|
|
25
|
+
autoload :Label, "chemicalml/cml/base/label"
|
|
26
|
+
autoload :List, "chemicalml/cml/base/list"
|
|
27
|
+
autoload :Matrix, "chemicalml/cml/base/matrix"
|
|
28
|
+
autoload :Metadata, "chemicalml/cml/base/metadata"
|
|
29
|
+
autoload :MetadataList, "chemicalml/cml/base/metadata_list"
|
|
30
|
+
autoload :Module, "chemicalml/cml/base/cml_module"
|
|
31
|
+
autoload :Molecule, "chemicalml/cml/base/molecule"
|
|
32
|
+
autoload :Name, "chemicalml/cml/base/name"
|
|
33
|
+
autoload :Parameter, "chemicalml/cml/base/parameter"
|
|
34
|
+
autoload :ParameterList, "chemicalml/cml/base/parameter_list"
|
|
35
|
+
autoload :Product, "chemicalml/cml/base/product"
|
|
36
|
+
autoload :ProductList, "chemicalml/cml/base/product_list"
|
|
37
|
+
autoload :Property, "chemicalml/cml/base/property"
|
|
38
|
+
autoload :PropertyList, "chemicalml/cml/base/property_list"
|
|
39
|
+
autoload :Reaction, "chemicalml/cml/base/reaction"
|
|
40
|
+
autoload :ReactionList, "chemicalml/cml/base/reaction_list"
|
|
41
|
+
autoload :Reactant, "chemicalml/cml/base/reactant"
|
|
42
|
+
autoload :ReactantList, "chemicalml/cml/base/reactant_list"
|
|
43
|
+
autoload :Scalar, "chemicalml/cml/base/scalar"
|
|
44
|
+
autoload :Substance, "chemicalml/cml/base/substance"
|
|
45
|
+
autoload :Unit, "chemicalml/cml/base/unit"
|
|
46
|
+
autoload :UnitList, "chemicalml/cml/base/unit_list"
|
|
47
|
+
autoload :UnitType, "chemicalml/cml/base/unit_type"
|
|
48
|
+
autoload :UnitTypeList, "chemicalml/cml/base/unit_type_list"
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Backward-compatible alias. New code should reference the versioned
|
|
4
|
+
# class directly: Chemicalml::Cml::Schema3::Bond.
|
|
5
|
+
module Chemicalml
|
|
6
|
+
module Cml
|
|
7
|
+
remove_const(:Bond) if const_defined?(:Bond, false)
|
|
8
|
+
const_set(:Bond, Chemicalml::Cml::Schema3::Bond)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Backward-compatible alias. New code should reference the versioned
|
|
4
|
+
# class directly: Chemicalml::Cml::Schema3::BondArray.
|
|
5
|
+
module Chemicalml
|
|
6
|
+
module Cml
|
|
7
|
+
remove_const(:BondArray) if const_defined?(:BondArray, false)
|
|
8
|
+
const_set(:BondArray, Chemicalml::Cml::Schema3::BondArray)
|
|
9
|
+
end
|
|
10
|
+
end
|