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

feat: Ket2 surface chemistry #2230

Draft
wants to merge 111 commits into
base: main
Choose a base branch
from
Draft

feat: Ket2 surface chemistry #2230

wants to merge 111 commits into from

Conversation

haditariq
Copy link
Contributor

@haditariq haditariq commented Oct 28, 2024

PR resolves: Issue#166.

  • format to save info: molfile with custom ELN tags.
  • transform a ketcher1 molfile with surface tag into ket2
  • User can use templates

Demo:

1- Basic Usage image template

k2SC.image.template.usage.mp4

2- Molfile compatibility with Ketcherrails and ketcher2

k2SC.-.Rails.and.ketcher2.compatibility.mp4

3- Modify image templates with new user templates

k2SC.-.use.template.with.image.templates.1.mp4

4- Redo and Undo features

redo.and.undo.feature.1.mp4

5- Erase Del will not work on image templates else should act same for other atoms/mols

erase.del.feature.k2sc.1.mp4

  • rather 1-story 1-commit than sub-atomic commits

  • commit title is meaningful => git history search

  • commit description is helpful => helps the reviewer to understand the changes

  • code is up-to-date with the latest developments of the target branch (rebased to it or whatever) => ⏩-merge for linear history is favoured

  • added code is linted

  • tests are passing (at least locally): we still have some random test failure on CI. thinking of asking spec/examples.txt to be commited

  • in case the changes are visible to the end-user,  video or screenshots should be added to the PR => helps with user testing

  • testing coverage improvement is improved.

  • CHANGELOG :  add a bullet point on top (optional: reference to github issue/PR )

  • parallele PR for documentation  on docusaurus  if the feature/fix is tagged for a release

@PiTrem PiTrem changed the title Ketcher surface chemistry feat: Ket2 surface chemistry Oct 29, 2024
@PiTrem PiTrem marked this pull request as draft October 29, 2024 08:43
@PiTrem PiTrem added the feature label Oct 29, 2024
@@ -20,6 +20,10 @@ def scrub_svg(fragment, encoding: nil)
def base_scrub_ml(fragment, type: :xml, encoding: nil)
result = encoding ? fragment.encode(encoding) : fragment

# Allow the <image> tag and all its attributes
scrubber = Loofah::Scrubber.new do |node|
node['src'] = node['src'] if node.name == 'image'
Copy link

Choose a reason for hiding this comment

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

Lint/SelfAssignment: Self-assignment detected.

when /chemdraw/i
Chemotion::ChemdrawSvgProcessor.new(svg)
when /ketcher/i
Ketcherails::SVGProcessor.new(svg)
else
Chemotion::OpenBabelSvgProcessor.new(svg)
end

editor === 'ketcher2' && is_centered = true
Copy link

Choose a reason for hiding this comment

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

Style/CaseEquality: Avoid the use of the case equality operator ===.

when /chemdraw/i
Chemotion::ChemdrawSvgProcessor.new(svg)
when /ketcher/i
Ketcherails::SVGProcessor.new(svg)
else
Chemotion::OpenBabelSvgProcessor.new(svg)
end

editor === 'ketcher2' && is_centered = true
Copy link

Choose a reason for hiding this comment

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

Lint/ShadowedArgument: Argument is_centered was shadowed by a local variable before it was used.

@haditariq haditariq force-pushed the ketcher-surface-chemistry branch 3 times, most recently from ada46b4 to 68e2891 Compare November 5, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants