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

allow pattern matching segment variables to take predicates #100

Merged
merged 3 commits into from
Jan 26, 2023

Conversation

sritchie
Copy link
Member

@sritchie sritchie commented Jan 26, 2023

  • allow pattern matching segment variables to take predicates #100:

    • Implements predicate support for segment, entire-segment and
      reverse-segment in emmy.pattern.match. This support bubbles up to forms
      in rules like (?? x pred1 pred2).

    • Removes the :emmy.pattern/ignored-restriction linter keyword, and all
      clj-kondo code warning that restrictions aren't supported on segment binding
      forms.

@sritchie sritchie force-pushed the sritchie/segment_pred branch from e8dfdbb to 867b61f Compare January 26, 2023 13:56
@sritchie sritchie added this to the 0.30.0 milestone Jan 26, 2023
@sritchie sritchie linked an issue Jan 26, 2023 that may be closed by this pull request
@@ -500,7 +516,7 @@
(let [match (pattern->combinators pattern)
success (fn [frame]
(when-let [m (pred frame)]
(when (and m (not (failed? m)))
(when (core/and m (not (failed? m)))
Copy link
Member Author

Choose a reason for hiding this comment

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

whoops!

@sritchie sritchie changed the title allow pattern matching segment variables to take predicates [in progress] allow pattern matching segment variables to take predicates Jan 26, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2023

Codecov Report

Base: 86.48% // Head: 86.43% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (815cb5f) compared to base (dc3cd96).
Patch coverage: 92.59% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #100      +/-   ##
==========================================
- Coverage   86.48%   86.43%   -0.05%     
==========================================
  Files          98       98              
  Lines       15246    15259      +13     
  Branches      782      786       +4     
==========================================
+ Hits        13185    13189       +4     
- Misses       1279     1284       +5     
- Partials      782      786       +4     
Impacted Files Coverage Δ
src/emmy/pattern/syntax.cljc 98.80% <ø> (ø)
src/emmy/pattern/match.cljc 98.19% <92.59%> (-1.81%) ⬇️
src/emmy/rational_function.cljc 80.89% <0.00%> (-0.85%) ⬇️
src/emmy/numsymb.cljc 92.23% <0.00%> (-0.23%) ⬇️
src/emmy/polynomial.cljc 83.28% <0.00%> (-0.16%) ⬇️
src/emmy/simplify/rules.cljc 68.78% <0.00%> (-0.08%) ⬇️
src/emmy/polynomial/factor.cljc 64.51% <0.00%> (ø)
src/emmy/mechanics/lagrange.cljc 99.02% <0.00%> (+<0.01%) ⬆️
src/emmy/mechanics/hamilton.cljc 84.79% <0.00%> (+0.04%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sritchie
Copy link
Member Author

@light-matters finally, here we go!

@sritchie sritchie merged commit 23248a9 into main Jan 26, 2023
@sritchie sritchie deleted the sritchie/segment_pred branch January 26, 2023 19:41
@light-matters
Copy link

@sritchie Great stuff! Apologies for being so unproductive, time in the day etc. :(. Now that I have the Wolfram bridge working with my existing research simulations though then I'm feeling the pull back to 'utils (emmy?!).

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.

Pattern rule segments don't respect predicates
3 participants