Skip to content

Comments

Format updates, SVG fixes#113

Merged
millenr merged 2 commits intomainfrom
format-updates
Jan 23, 2026
Merged

Format updates, SVG fixes#113
millenr merged 2 commits intomainfrom
format-updates

Conversation

@millenr
Copy link
Contributor

@millenr millenr commented Jan 21, 2026

This pull request introduces several improvements and refactors across the backend and frontend to standardize the handling of predicted synthesis graphs, improve robustness in molecule drawing utilities, and enhance compatibility and clarity in the codebase. The most significant changes include renaming and supporting both predicted_synth_graph and the deprecated predictive_synth_graph for backward compatibility, updating the molecule drawing logic for more robust atom highlighting, and updating the RDKit dependency version.

Backend: Synthesis Graph Key Standardization and Compatibility

  • Standardized the key for predicted synthesis graphs to predicted_synth_graph throughout the API and data files, while maintaining backward compatibility with the deprecated predictive_synth_graph key. Updated logic in the data conversion and Cytoscape export functions to check for both keys, preferring the new one. [1] [2] [3] [4] [5] [6]
  • Updated parameter and variable names from predictive_synth_graph/predicted_route to predicted_synth_graph/is_predicted for clarity and consistency, including in function signatures and docstrings. [1] [2] [3] [4] [5] [6] [7]

Backend: Molecule Drawing Robustness

  • Improved the determine_highlight_colors function to be more robust: now, during the drawing phase, only atoms with known map numbers are highlighted, and missing map numbers are skipped instead of raising errors. The logic for assigning colors and highlighting bonds is clarified and made more fault-tolerant.
  • In mol_to_image and related functions, ensured that show_atom_indices is properly propagated and handled, preventing abbreviation logic from interfering when atom indices are shown. [1] [2]
  • In reaction SMILES image rendering, adjusted logic to only split molecules when not highlighting, preventing highlight issues with multi-component molecules.

Backend: Dependency Update

  • Updated the RDKit dependency version in environment.yml from 2024.3.5 to 2025.03.2 for improved compatibility and features.

Backend: Logging and Error Handling

  • Added error logging for SVG generation failures in the reaction SMILES endpoint for better debugging.

Frontend: Synthesis Graph Selection and Example Data

  • Updated the frontend (NetworkSearchMenu.jsx) to distinguish between primary, evidence, and predicted synthesis graphs, only displaying evidence/predicted graphs if they differ from the primary graph, and supporting both predicted_synth_graph and the deprecated predictive_synth_graph keys. [1] [2]
  • Updated App.js and example graph lists to use the new predicted graph logic and added a new example file for merged routes. [1] [2]

These changes collectively improve code clarity, maintainability, and robustness, while ensuring backward compatibility with older data formats.

@millenr millenr requested a review from walkerbdev January 21, 2026 20:05
@millenr millenr changed the title Format updates Format updates, SVG fixes Jan 21, 2026
Copy link
Contributor

@walkerbdev walkerbdev left a comment

Choose a reason for hiding this comment

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

Test locally LGTM

@millenr millenr merged commit 1936416 into main Jan 23, 2026
4 of 7 checks passed
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.

2 participants