Skip to content

Conversation

@pesap
Copy link
Collaborator

@pesap pesap commented Jan 21, 2026

This PR also updates the simplified discovery process for r2x-core. See NatLabRockies/r2x-core#76

Sync vibe coded. Can you check it meets our criteria? @micahpw

pesap and others added 10 commits January 19, 2026 12:44
- Remove PackageAstCache::build() that parsed ALL Python files upfront
- Add targeted file-by-file parsing for entry points only
- Add ast-grep CLI fallback for finding Plugin classes when entry_points.txt is missing
- Add on-demand config class search using ast-grep pattern matching
- Add serde_json dependency for parsing ast-grep JSON output

This fixes the sync time regression from <30ms to ~2900ms by only parsing
the 2-5 entry point files actually needed instead of all 50+ files in a package.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Consolidate imports and remove redundant local use statements
- Extract is_skipped_param() helper to deduplicate param filtering logic
- Simplify find_config_in_common_locations() with filename array
- Convert extract_params_from_match() to functional filter_map style
- Simplify argument_to_config_field() using existing clean_default_value
- Make io_contract_for_kind() match exhaustive, merge identical arms
- Simplify extract_class_init_params() with early return pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pesap pesap changed the title fix(sync) fix(sync): fixing sync command and enhancing ipython Cli Jan 21, 2026
@pesap pesap requested a review from micahpw January 21, 2026 00:03
@micahpw
Copy link
Contributor

micahpw commented Jan 21, 2026

@pesap I can't really test this on my end. The plugins aren't being discovered anymore.

mwebb@mwebb-43264s r2x-cli % cargo run list
Finished dev profile [unoptimized + debuginfo] target(s) in 0.06s
Running target/debug/r2x list
Plugins:
r2x-plexos: v0.1.3
- plexos

r2x-plexos-to-sienna: v0.0.0
- plexos-to-sienna

r2x-reeds: v0.3.3
- reeds

r2x-reeds-to-plexos: v0.0.0
- reeds-to-plexos

r2x-reeds-to-sienna: v0.0.0
- reeds-to-sienna

r2x-sienna: v0.1.0
- sienna

r2x-sienna-to-plexos: v0.0.0
- sienna-to-plexos

Total plugin packages: 7

@pesap
Copy link
Collaborator Author

pesap commented Jan 21, 2026

@pesap I can't really test this on my end. The plugins aren't being discovered anymore.

mwebb@mwebb-43264s r2x-cli % cargo run list Finished dev profile [unoptimized + debuginfo] target(s) in 0.06s Running target/debug/r2x list Plugins: r2x-plexos: v0.1.3 - plexos

r2x-plexos-to-sienna: v0.0.0 - plexos-to-sienna

r2x-reeds: v0.3.3 - reeds

r2x-reeds-to-plexos: v0.0.0 - reeds-to-plexos

r2x-reeds-to-sienna: v0.0.0 - reeds-to-sienna

r2x-sienna: v0.1.0 - sienna

r2x-sienna-to-plexos: v0.0.0 - sienna-to-plexos

Total plugin packages: 7

Can you try with the plugins on this branch? NatLabRockies/r2x-reeds#41

@micahpw
Copy link
Contributor

micahpw commented Jan 21, 2026

@pesap I can't really test this on my end. The plugins aren't being discovered anymore.
mwebb@mwebb-43264s r2x-cli % cargo run list Finished dev profile [unoptimized + debuginfo] target(s) in 0.06s Running target/debug/r2x list Plugins: r2x-plexos: v0.1.3 - plexos
r2x-plexos-to-sienna: v0.0.0 - plexos-to-sienna
r2x-reeds: v0.3.3 - reeds
r2x-reeds-to-plexos: v0.0.0 - reeds-to-plexos
r2x-reeds-to-sienna: v0.0.0 - reeds-to-sienna
r2x-sienna: v0.1.0 - sienna
r2x-sienna-to-plexos: v0.0.0 - sienna-to-plexos
Total plugin packages: 7

Can you try with the plugins on this branch? NREL/r2x-reeds#41

Still the same issue. I only see the top level packages and not the individual plugins like upgrader, parser, etc.

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.

3 participants