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) Dynamic Wildcards #114

Merged
merged 9 commits into from
Mar 21, 2024
Merged

Conversation

mwootendev
Copy link
Contributor

This is actually a complete replacement of the work done in #110. This will replace the main source code added in that PR, but retain the test cases to ensure backwards compatibility.

After trying to refactor #110 into a cleaner solution, I came to a better understanding of how the library was structured. The original solution supported variables, but seemed like a hack.

The new solution updates wildcards to support either strings or Commands for the wildcard value. This now permits actual VariableAccessCommand or SequenceCommand instances as the value, which are resolved before resolving the wildcard. This new implementation also supports variants in the wildcard path. Wildcards of the form __wildcard/${variable:default}__ and __wildcard/{opt1|opt2|opt3}__ are now supported.

@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (ff47441) 97.43% compared to head (744f5f3) 97.45%.

Files Patch % Lines
src/dynamicprompts/commands/wildcard_command.py 66.66% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   97.43%   97.45%   +0.01%     
==========================================
  Files          77       77              
  Lines        3352     3337      -15     
==========================================
- Hits         3266     3252      -14     
+ Misses         86       85       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@akx akx self-requested a review December 21, 2023 07:52
Copy link
Collaborator

@akx akx left a comment

Choose a reason for hiding this comment

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

Nice cleanup 👍

Again, sorry for the delay.

@akx akx merged commit e0cef0a into adieyal:main Mar 21, 2024
5 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.

3 participants