Skip to content
Snippets Groups Projects

Draft: Fixed issues in the Formula class, added tests, improved the description of formulas.

Closed Lauri Himanen requested to merge 1259-fix-issue-in-reduced-formula-creation into develop
3 unresolved threads
3 files
+ 113
47
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 18
16
@@ -1035,8 +1035,9 @@ class System(MSection):
formula_hill = Quantity(
type=str,
description='''
The chemical formula for a structure in Hill form with element symbols followed by
integer chemical proportion numbers. The proportion number MUST be omitted if it is 1.
The chemical formula for a structure in Hill form with element
symbols followed by non-reduced integer chemical proportion numbers.
The proportion number is omitted if it is 1.
''',
a_elasticsearch=[
Elasticsearch(material_type, normalizer=atomutils.get_formula_hill),
@@ -1046,8 +1047,8 @@ class System(MSection):
formula_reduced = Quantity(
type=str,
description='''
The reduced chemical formula for a structure as a string with element symbols and
integer chemical proportion numbers. The proportion number MUST be omitted if it is 1.
Alphabetically sorted chemical formula with reduced integer chemical
proportion numbers. The proportion number is omitted if it is 1.
''',
a_elasticsearch=[
Elasticsearch(material_type),
@@ -1057,10 +1058,10 @@ class System(MSection):
formula_anonymous = Quantity(
type=str,
description='''
The anonymous formula is the chemical_formula_reduced, but where the elements are
instead first ordered by their chemical proportion number, and then, in order left to
right, replaced by anonymous symbols A, B, C, ..., Z, Aa, Ba, ..., Za, Ab, Bb, ... and
so on.
Formula where the elements are ordered by their reduced chemical
proportion number, and then, in order left to right, replaced by
anonymous symbols A, B, C, ..., Z, Aa, Ba, ..., Za, Ab, Bb, ... and
so on. The proportion number is omitted if it is 1.
''',
a_elasticsearch=[
Elasticsearch(material_type),
@@ -1233,8 +1234,8 @@ class Material(MSection):
chemical_formula_reduced = Quantity(
type=str,
description='''
The reduced chemical formula for a structure as a string with element symbols and
integer chemical proportion numbers. The proportion number MUST be omitted if it is 1.
Alphabetically sorted chemical formula with reduced integer chemical
proportion numbers. The proportion number is omitted if it is 1.
''',
a_elasticsearch=[
Elasticsearch(material_type),
@@ -1244,8 +1245,9 @@ class Material(MSection):
chemical_formula_hill = Quantity(
type=str,
description='''
The chemical formula for a structure in Hill form with element symbols followed by
integer chemical proportion numbers. The proportion number MUST be omitted if it is 1.
The chemical formula for a structure in Hill form with element
symbols followed by non-reduced integer chemical proportion numbers.
The proportion number is omitted if it is 1.
''',
a_elasticsearch=[
Elasticsearch(material_type, normalizer=atomutils.get_formula_hill),
@@ -1255,10 +1257,10 @@ class Material(MSection):
chemical_formula_anonymous = Quantity(
type=str,
description='''
The anonymous formula is the chemical_formula_reduced, but where the elements are
instead first ordered by their chemical proportion number, and then, in order left to
right, replaced by anonymous symbols A, B, C, ..., Z, Aa, Ba, ..., Za, Ab, Bb, ... and
so on.
Formula where the elements are ordered by their reduced chemical
proportion number, and then, in order left to right, replaced by
anonymous symbols A, B, C, ..., Z, Aa, Ba, ..., Za, Ab, Bb, ... and
so on. The proportion number is omitted if it is 1.
''',
a_elasticsearch=[
Elasticsearch(material_type),
Loading