Skip to content

Xmvbcloud - #1

Closed
Loach1703 wants to merge 3 commits into
xmvbcloudfrom
main
Closed

Xmvbcloud#1
Loach1703 wants to merge 3 commits into
xmvbcloudfrom
main

Conversation

@Loach1703

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 25, 2026 12:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are confirmed backward-compatibility and UX bugs in option parsing (draw_xmo flag form) and in plotting option semantics (projection silently ignored for --connectivity rdkit, plus related CLI/help inconsistencies).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR restructures and documents the command-line interface of autoVB, consolidating XMO plotting under a unified xmo2svg implementation (with draw_xmo as an alias), and renaming legacy script entry points (autovb_nboxyz2nbo, autovb_xminbo2xmi) to clearer user-facing commands.

Changes:

  • Added a reusable plotting implementation in vbkit/xmo2svg.py and updated the CLI to use it (including a new --connectivity option).
  • Updated VBSettings/parsing to support additional weight tables (inverse, renormalized) and to alias draw_xmoxmo2svg.
  • Expanded/updated Chinese & English user guides and README to reflect the new CLI tools and plotting behavior.
File summaries
File Description
UserGuide.md Updates plotting parameter docs and adds a comprehensive “Command-Line Tools” section (CN).
UserGuide_en.md Same as above for the English guide.
src/autoVB/vbkit/xmo2svg.py Introduces a shared xmo2svg_file() implementation plus report-line generation.
src/autoVB/nbo/nbo.py Uses origin_filename for molecule_name when generating XMI data.
src/autoVB/main.py Removes legacy draw_xmo workflow step; routes plotting through xmo2svg and logs report lines.
src/autoVB/io/readers.py Adds draw_xmoxmo2svg aliasing in option parsing.
src/autoVB/draw_xmo/xmo_drawer_input_converter.py Extends supported weight tables and updates legend labeling accordingly.
src/autoVB/cli/xmo2svg.py Refactors CLI to call the shared vbkit implementation; adds --connectivity.
src/autoVB/cli/xmi.py Updates CLI program name to nbo2xmi.
src/autoVB/cli/nbo.py Updates CLI program name to xyz2nbo.
src/autoVB/cli/draw_xmo.py Turns draw_xmo into a thin alias of xmo2svg.
README.md Refreshes installation instructions and documents the new CLI commands.
pyproject.toml Renames script entry points and adds fch2xmi as an alias of fch2vb.
Review details

Suppressed comments (2)

src/autoVB/io/readers.py:360

  • draw_xmo is aliased to xmo2svg, but when users specify it as a flag (e.g. autovb{draw_xmo}) this code sets value=True and then tries to parse it as Optional[str], which triggers an AttributeError (bool has no .startswith) and silently skips the option. This breaks backward compatibility and means draw_xmo may do nothing without an explicit value.
        for pair in pair_list:
            if "=" not in pair:
                key = pair.strip()
                value = True
            else:

src/autoVB/cli/xmo2svg.py:54

  • The CLI description still claims it generates SVGs "using $orb labels for molecular connectivity", but --connectivity rdkit is now supported. The help text should reflect both modes (or indicate $orb is only the default).
    parser = argparse.ArgumentParser(
        prog="xmo2svg",
        description=(
            "Read an XMO file and generate valence-bond SVG files using "
            "$orb labels for molecular connectivity."
        ),
    )
  • Files reviewed: 13/13 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +106 to +116
if connectivity == "orb":
drawer = OrbitalConnectivityMoleculeDrawer(
**drawer_kwargs,
orbital_atom_rows=parsed_data.orb,
projection=projection,
condense_hydrogens=condense_hydrogens,
)
elif connectivity == "rdkit":
drawer = MoleculeBondVariantDrawer(**drawer_kwargs)
else:
raise ValueError(f"Unsupported connectivity mode: {connectivity}")
Comment thread pyproject.toml
Comment on lines +20 to +26
xyz2nbo = "autoVB.cli.nbo:autovb_nbo"
nbo2xmi = "autoVB.cli.xmi:autovb_xmi"
autovb = "autoVB.cli.autovb:autovb_main"
autovb_test = "autoVB.cli.autovb_test:autovb_test"
draw_xmo = "autoVB.cli.draw_xmo:draw_xmo"
draw_xmo = "autoVB.cli.xmo2svg:xmo2svg"
fch2vb = "autoVB.cli.fch2vb:fch2vb"
fch2xmi = "autoVB.cli.fch2vb:fch2vb"
Comment thread src/autoVB/cli/xmo2svg.py
Comment on lines +4 to 12
from ..vbkit.xmo2svg import (
DEFAULT_XMO_ACTIVE_SPACE_COLOR,
DEFAULT_XMO_ACTIVE_SPACE_WIDTH,
DEFAULT_XMO_MAX_STRUCTURES,
DEFAULT_XMO_STRUCTURES_PER_ROW,
DEFAULT_XMO_WEIGHT_TABLE,
parse_draw_xmo_max_structures,
parse_draw_xmo_structures_per_row,
xmo2svg_file,
xmo2svg_report_lines,
)
@Loach1703 Loach1703 closed this Aug 25, 2026
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