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

#1852 Implements automatic selection of mol encoding #1870

Merged
merged 8 commits into from
Nov 29, 2022

Conversation

porcelain11
Copy link
Collaborator

Implements automatic selection of mol encoding: add "molAuto" to SupportedFormat type and to formatProperties - with { 'molfile-saving-mode': 'auto' } option.

@@ -29,6 +29,22 @@ import assert from 'assert'
import { EventEmitter } from 'events'
import { runAsyncAction } from 'utilities'

const Format = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to add type for this object. It can be something like:

const Format: {
  [key in SupportedFormat]: SupportedFormat
}

This way you don't need to write

Format.SomeFormat as SupportedFormat

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, pls check if it is a good solution

@@ -117,7 +122,7 @@ const MiewDialog = ({
(miew: MiewAsType) => {
miewRef.current = miew
const factory = new FormatterFactory(server)
const service = factory.create('cml')
const service = factory.create('cml' as SupportedFormat)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also change to SupportedFormat.cml?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@porcelain11 porcelain11 force-pushed the #1852-automatic-selection-of-mol-encoding branch from 5dc82ec to 612fff2 Compare November 29, 2022 12:06
@Nitvex Nitvex merged commit 1296bd7 into master Nov 29, 2022
@Nitvex Nitvex deleted the #1852-automatic-selection-of-mol-encoding branch November 29, 2022 18:49
@Nitvex Nitvex linked an issue Nov 30, 2022 that may be closed by this pull request
Nitvex pushed a commit that referenced this pull request Dec 7, 2022
* #1852 Implements automatic selection of mol encoding

* #1852 Refactor types

* #1852 Fix errors in identifyStructFormat

* #1852 Fix build

* #1852 Fix react build errors

* #1852 Run prettier to fix build

* #1852 Small fix on comments

* #1852 Fix build (prettier-write)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic selection of mol v2000 or mol v3000 encoding
2 participants