Skip to content
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

#1600-wrong-sign-in-ket #1626

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('deserialize (ToStruct)', () => {
const preparedAtoms = parsedPrepareContent.mol0.atoms
preparedAtoms.forEach((props, id) => {
const locationWithNegativeY = props.location.map((coordinate, index) => {
return index === 1 && props.label ? -coordinate : coordinate
return index === 1 ? -coordinate : coordinate
})
const relatedAtom = deserData.atoms.get(id)
const label = props.type === 'rg-label' ? 'R#' : 'C'
Expand Down Expand Up @@ -175,9 +175,7 @@ describe('serialize (ToKet)', () => {
it('correct work with atoms', () => {
parsedNewPrepareStruct.mol0.atoms.forEach((atom, id) => {
const relatedAtom = parsedPrepareContent.mol0.atoms[id]
if (relatedAtom.label) {
relatedAtom.location[1] = -relatedAtom.location[1]
}
relatedAtom.location[1] = -relatedAtom.location[1]
expect(atom).toEqual(relatedAtom)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function rglabelToStruct(source) {
params.label = 'R#'
ifDef(params, 'pp', {
x: source.location[0],
y: source.location[1],
y: -source.location[1],
z: source.location[2] || 0.0
})
ifDef(params, 'attpnt', source.attachmentPoints)
Expand All @@ -104,7 +104,7 @@ export function atomListToStruct(source) {
params.label = 'L#'
ifDef(params, 'pp', {
x: source.location[0],
y: source.location[1],
y: -source.location[1],
z: source.location[2] || 0.0
})
ifDef(params, 'attpnt', source.attachmentPoints)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function rglabelToKet(source) {
const result = {
type: 'rg-label'
}
ifDef(result, 'location', [source.pp.x, source.pp.y, source.pp.z])
ifDef(result, 'location', [source.pp.x, -source.pp.y, source.pp.z])
ifDef(result, 'attachmentPoints', source.attpnt, 0)

const refsToRGroups = fromRlabel(source.rglabel).map(
Expand All @@ -105,7 +105,7 @@ function atomListToKet(source) {
const result = {
type: 'atom-list'
}
ifDef(result, 'location', [source.pp.x, source.pp.y, source.pp.z])
ifDef(result, 'location', [source.pp.x, -source.pp.y, source.pp.z])
ifDef(result, 'attachmentPoints', source.attpnt, 0)
ifDef(result, 'elements', source.atomList.labelList())
ifDef(result, 'notList', source.atomList.notList, false)
Expand Down