-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property 'fractional_site_positions' #206
base: develop
Are you sure you want to change the base?
Property 'fractional_site_positions' #206
Conversation
…fractional_site_positions' are provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, except for the inline comment; and one general thing:
The way you have implemented this clearly requires the cartisian_site_positions
and fractional_site_positions
to be in the exact same order - line-by-line referring to the same coordinates. I think that requirement should be written down somewhere; I suggest in the list of requirements on fractional_site_positions
.
Requirement added in 8eefdd2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I've written in other issues/commits, I very much like the idea of standardizing fractional_site_positions
. But I realize now with this PR in hand that if we do it this way, fractional_site_positions
and cartesian_site_positions
become "equal citizens". I.e., it would be OK for an implementation to support only the fractional_site_positions
part of the specification and refuse to deal with cartesian_site_positions
. This is a problem from a standards-perspective. Can we solve that somehow?
In this PR
Edit: Actually, I've run through the specification, and it seems that even properties that MUST be included in the response may still be included with |
…sian and fractional coordinates. Co-Authored-By: Rickard Armiento <[email protected]>
Co-Authored-By: Rickard Armiento <[email protected]>
fractional\_site\_positions | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- **Description**: Positions of each site expressed as fractions of the `lattice_vectors`_. Description of a site matches the one given in `cartesian_site_positions`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is currently formulated, fractional_site_positions
and cartesian_site_positions
have different status: cartesian
is the primary definition, and both species_at_sites
and fractional...
refer to cartesian...
. However, mathematically, cartesian...
and fractional...
are equivalent descriptions, and either of them or even both may be absent. It then makes this description ambiguous, since, if cartesian_site_positions
are absent, it is not clear what the fractional_site_positions
must match.
It seems therefore that it would be more consistent to describe species_at_site
as a primary definition of an atomic site, and to let both fractional_site_positions
and cartesian_site_positions
refer to the species_at_site
when the order and number of array elements is defined for each fractional
and cartesian
.
@@ -1710,14 +1731,14 @@ nsites | |||
species\_at\_sites | |||
~~~~~~~~~~~~~~~~~~ | |||
|
|||
- **Description**: Name of the species at each site (where values for sites are specified with the same order of the property `cartesian_site_positions`_). | |||
- **Description**: Name of the species at each site (where values for sites are specified with the same order of the properties `cartesian_site_positions`_ and `fractional_site_positions`_). | |||
The properties of the species are found in the property `species`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest that species_at_sites
are moved to the beginning of the specification, and fractional_site_positions
and cartesian_size_positions
should both refer to the species_at_sites
section.
The properties of the species are found in the property `species`_. | ||
- **Type**: list of strings. | ||
- **Requirements/Conventions**: | ||
|
||
- **Response**: REQUIRED in the response unless explicitly excluded. | ||
- **Query**: Support for queries on this property is OPTIONAL. If supported, filters MAY support only a subset of comparison operators. | ||
- MUST have length equal to the number of sites in the structure (first dimension of the list property `cartesian_site_positions`_). | ||
- MUST have length equal to the number of sites in the structure (first dimension of the list properties `cartesian_site_positions`_ and `fractional_site_positions`_). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When species_at_site
are moved to the front, the fractional_site_positions
should the refer to species_at_sites
, not vice versa.
- If a component of the position is unknown, the :val:`null` value should be provided instead (see section `Properties with unknown value`_). | ||
Otherwise, it should be a float value. | ||
If at least one of the coordinates is unknown, the correct flag in the list property `structure_features`_ MUST be set. | ||
- The order of the list MUST match the order of `cartesian_site_positions`_, i.e., the list refers to the same positions as `cartesian_site_positions` *in the exact same order*, only expressed in fractional coordinates instead of cartesian. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order of elements in both fractional_site_positions
and cartesian_site_positions
should refer to site descriptions, not to each other; the only suitable property that we specify currently is species_at_sites
.
- **Type**: list of list of floats and/or unknown values | ||
- **Requirements/Conventions**: | ||
|
||
- **Response**: OPTIONAL in the response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest specifying that:
`fractional_site_positions` and `cartesian_site_positions` MAY be both present in the same response.
If they are both present, they SHOULD describe the same points in space, i.e. cartesian coordinates
of sites should be the same as fractional coordinates of the same sites with orthogonalisation
convention, as expressed in `lattice_vectors`, applied.
cartesian_site_positions[isite][x,y,z] =
fractional_site_positions[isite][x,y,z] * latice_vectors[][];
where:
- isite is index of the site (isite = 0..length(species_at_site[])-1);
- '*' is understood in matrix multiplcation sense;
- each lattiec_vectors[i] element (i=0..2) is the
corresponding lattice vector, \vec{a}, \vec{b} and \vec{c}.
- both cartesian_site_positions[isite][x,y,z] and
fractional_site_positions[isite][x,y,z] are row-vectors
(not column-vectors).
I have been concerned about this since we started allowing However, with
In the first case, we still have interoperability for all cases where it makes sense. A database either does not support coordinates at all (in which case interoperability with a client that wants coordinates is not possible) or it supports coordinates via In the second case, we set ourselves up for a possible mismatch. The client wants coordinates from Hence, it is my firm belief that if we are to accept the present PR, there needs to be some facility that says that IF you support With the realization that we are opening a can of worms by allowing more than one standardized way to represent data, perhaps we need to delay this PR beyond 1.0 and sort out exactly how this should be handled? |
…cartesian_site_positions' of #216.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Requirements/Conventions**: | ||
|
||
- **Response**: REQUIRED in the response unless explicitly excluded, except when property `dimension_types`_ is equal to :val:`[0, 0, 0]` (in this case it is OPTIONAL). | ||
- **Response**: REQUIRED in the response unless explicitly excluded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Query**: Support for queries on this property is OPTIONAL. If supported, filters MAY support only a subset of comparison operators. | ||
- MUST be a list of three vectors *a*, *b*, and *c*, where each of the vectors MUST BE a list of the vector's coordinates along the x, y, and z Cartesian coordinates. | ||
(Therefore, the first index runs over the three lattice vectors and the second index runs over the x, y, z Cartesian coordinates). | ||
- For databases that do not define an absolute Cartesian system (e.g., only defining the length and angles between vectors), the first lattice vector SHOULD be set along *x* and the second on the *xy*-plane. | ||
- This property MUST be an array of dimensions 3 times 3 regardless of the elements of property `dimension_types`_. The vectors SHOULD by convention be chosen so the determinant of the :property:`lattice_vectors` matrix is different from zero. The vectors in the non-periodic directions have no significance beyond fulfilling these requirements. | ||
- :val:`null` values are allowed in the output. A vector of :val:`[null, null, null]` MAY be used for non-periodic directions where a numerical vector would not be meaningful. However, if the implementation also supports the `fractional_site_positions`_ property, the lattice vectors are relevant also for the non-periodic directions, and thus no all-`null` vectors are expected in the output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- :val:`null` values are allowed in the output. A vector of :val:`[null, null, null]` MAY be used for non-periodic directions where a numerical vector would not be meaningful. However, if the implementation also supports the `fractional_site_positions`_ property, the lattice vectors are relevant also for the non-periodic directions, and thus no all-`null` vectors are expected in the output. | |
- :val:`null` values are allowed in the output. A vector of :val:`[null, null, null]` MAY be used for non-periodic directions where a numerical vector would not be meaningful (including a zero vector). However, if the implementation also supports the `fractional_site_positions`_ property, the lattice vectors are relevant also for the non-periodic directions, and thus no all-`null` vectors are allowed in the output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a related question is, why are null
-vectors necessary, when one can apply zero vectors? Unless zero vectors have a meaning different from null
-vectors when using fractional_site_positions
.
nsites | ||
~~~~~~ | ||
|
||
- **Description**: An integer specifying the length of the :property:`cartesian_site_positions` property. | ||
- **Description**: An integer specifying the length of :property:`cartesian_site_positions` and :property:`fractional_site_positions` properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As was pointed out by @sauliusg, this should refer instead only to species_at_sites
.
@@ -1710,14 +1731,14 @@ nsites | |||
species\_at\_sites | |||
~~~~~~~~~~~~~~~~~~ | |||
|
|||
- **Description**: Name of the species at each site (where values for sites are specified with the same order of the property `cartesian_site_positions`_). | |||
- **Description**: Name of the species at each site (where values for sites are specified with the same order of the properties `cartesian_site_positions`_ and `fractional_site_positions`_). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Description**: Name of the species at each site (where values for sites are specified with the same order of the properties `cartesian_site_positions`_ and `fractional_site_positions`_). | |
- **Description**: Name of the species at each site (where values for sites are specified with the same order of the properties `cartesian_site_positions`_ as well as `fractional_site_positions`_). |
I discourage and
, even though it is correct, simply due to the fuzzyness it may present for an implementer in terms of "should it be the sum of these properties then"?
@@ -1912,7 +1933,7 @@ structure\_features | |||
- **List of strings used to indicate special structure features**: | |||
|
|||
- :val:`disorder`: This flag MUST be present if any one entry in the :property:`species` list has a :property:`chemical_symbols` list that is longer than 1 element. | |||
- :val:`unknown_positions`: This flag MUST be present if at least one component of the :property:`cartesian_site_positions` list of lists has value :val:`null`. | |||
- :val:`unknown_positions`: This flag MUST be present if at least one component of the :property:`cartesian_site_positions` and :property:`fractional_site_positions` lists of lists has value :val:`null`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- :val:`unknown_positions`: This flag MUST be present if at least one component of the :property:`cartesian_site_positions` and :property:`fractional_site_positions` lists of lists has value :val:`null`. | |
- :val:`unknown_positions`: This flag MUST be present if at least one component of the :property:`cartesian_site_positions` or :property:`fractional_site_positions` lists of lists has value :val:`null`. |
Did the consensus evolve on this at either of the last 2 workshops? If this is something we still cannot deal with, I would suggest closing this PR (even if only temporarily). |
I don't think we yet have a resolution to my comment above:
But the PR is good otherwise, so isn't it better to mark it with a label that means that there is something fundamental that needs to be worked out, but leaving it open? |
I prefer keeping the PR open as well. Once closed, a PR becomes virtually invisible and it is easy to forget it, scrapping all the effort. |
It is my understanding that this is going to be superseded by |
In #196 @rartino and I discussed the need to have a
structures
property for reduced (a.k.a. fractional) atom coordinates. This PR introducesfractional_site_positions
among the standardized properties. I have copied the most of the text fromcartesian_site_positions
and slightly adjusted the relationships of the two coordinate-based properties. I have also changed a bit the definition oflattice_vectors
, thus this PR fixes #196.