Skip to content

v0.2.3#11

Open
jhollway wants to merge 3 commits intomainfrom
develop
Open

v0.2.3#11
jhollway wants to merge 3 commits intomainfrom
develop

Conversation

@jhollway
Copy link
Copy Markdown
Contributor

Description

Checklist:

  • Documentation
    • DESCRIPTION file version is bumped by the appropriate increment (major, minor, patch)
    • Date in DESCRIPTION is correct
    • Longer functions are commented inline or broken down into helper functions to help debugging
  • PR form
    • Title indicates expected version number
    • PR description above and the NEWS.md file are aligned
    • Description above itemizes changes under subsection titles, e.g. "## Data"
    • Closed, fixed, or related issues are referenced and explained in the description above, e.g. "Fixed #0 by adding A"

Copilot AI review requested due to automatic review settings April 25, 2026 13:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR bumps the package to v0.2.3 and updates Tutorial 5 (“Position and Equivalence”) to address an object reference issue in the structural equivalence section.

Changes:

  • Bumped DESCRIPTION version/date and added a NEWS.md entry for 0.2.3.
  • Updated Tutorial 5 source (position.Rmd) and rendered output (position.html) with revised object usage (to_named(ison_algebra) / alge).
  • Ignored new local/tooling files via .gitignore / .Rbuildignore.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
inst/tutorials/tutorial5/position.Rmd Updates tutorial setup and exercise chunks around to_named() / alge usage.
inst/tutorials/tutorial5/position.html Re-rendered tutorial output reflecting the updated Rmd code and learnr metadata.
NEWS.md Adds release notes for 0.2.3 (tutorial fix).
DESCRIPTION Bumps package version to 0.2.3 and updates the Date field.
.gitignore Ignores .positai.
.Rbuildignore Ensures .positai / .claude aren’t included in builds; adjusts .mailmap entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


```{r strict, exercise = TRUE, exercise.setup = "varyclust"}
plot(node_in_structural(alge, k = "strict"))
plot(node_in_structural(to_named(ison_algebra), k = "strict"))
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

exercise.setup = "varyclust" already defines alge <- to_named(ison_algebra) for consistent fake names. Calling to_named(ison_algebra) again here can change node labels between the dendrograms and this plot (and between runs). Use alge instead so the tutorial’s examples stay consistent.

Suggested change
plot(node_in_structural(to_named(ison_algebra), k = "strict"))
plot(node_in_structural(alge, k = "strict"))

Copilot uses AI. Check for mistakes.
data-completion="1" data-diagnostics="1" data-startover="1"
data-lines="0" data-pipe="|&gt;">
<pre class="text"><code>plot(node_in_structural(alge, k = 2))</code></pre>
<pre class="text"><code>plot(node_in_structural(to_named(ison_algebra), k = 2))</code></pre>
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

This snippet switched from using the previously defined alge to calling to_named(ison_algebra) inline. Since to_named() can generate different fake names each call, this can make node labels inconsistent across the tutorial. Prefer plot(node_in_structural(alge, ...)) with alge set once in setup.

Copilot uses AI. Check for mistakes.
Comment thread .Rbuildignore
^CRAN-SUBMISSION$
^README\.Rmd$
^.mailmap$ No newline at end of file
^.mailmap$
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

In .Rbuildignore entries are regexes; ^.mailmap$ treats . as “any character”, so it can match unintended filenames (e.g., xmailmap). Escape the dot to only ignore the .mailmap file (i.e., ^\.mailmap$).

Suggested change
^.mailmap$
^\.mailmap$

Copilot uses AI. Check for mistakes.
We can graph this of course, as above:

```{r strplot, exercise = TRUE, exercise.setup = "varyclust"}
alge <- to_named(ison_algebra)
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

alge is already available from exercise.setup = "varyclust". Re-creating it with to_named(ison_algebra) here can change the node labels relative to the dendrograms shown earlier, making the tutorial harder to follow. Prefer using the existing alge object.

Suggested change
alge <- to_named(ison_algebra)

Copilot uses AI. Check for mistakes.
Comment on lines +574 to +575
<pre class="text"><code>plot(node_in_structural(to_named(ison_algebra), k = &quot;elbow&quot;))
plot(node_in_structural(to_named(ison_algebra), k = &quot;silhouette&quot;))</code></pre>
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

These examples now call to_named(ison_algebra) for each plot. Because to_named() may generate different fake names on each call, the elbow vs silhouette plots may not be directly comparable in the rendered tutorial. Reuse a single alge <- to_named(ison_algebra) defined once in setup and pass alge into node_in_structural().

Copilot uses AI. Check for mistakes.
data-diagnostics="1" data-startover="1" data-lines="0"
data-pipe="|&gt;">
<pre class="text"><code>plot(node_in_structural(alge, k = &quot;strict&quot;))</code></pre>
<pre class="text"><code>plot(node_in_structural(to_named(ison_algebra), k = &quot;strict&quot;))</code></pre>
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

Same as the earlier chunks: this calls to_named(ison_algebra) inline, which can lead to inconsistent node labels across tutorial steps. Prefer using a single alge object created once in the tutorial setup and then calling node_in_structural(alge, k = "strict").

Copilot uses AI. Check for mistakes.
Comment on lines +623 to +624
<pre class="text"><code>alge &lt;- to_named(ison_algebra)
alge %&gt;%
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

This chunk reassigns alge <- to_named(ison_algebra) locally even though the tutorial setup already creates alge. Re-running to_named() here can change fake names mid-tutorial, making it harder to relate this plot back to earlier dendrograms. Reuse the existing alge from setup instead of re-creating it.

Copilot uses AI. Check for mistakes.

```{r k-discrete, exercise = TRUE, exercise.setup = "varyclust"}
plot(node_in_structural(alge, k = 2))
plot(node_in_structural(to_named(ison_algebra), k = 2))
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

varyclust (the exercise setup) already defines alge <- to_named(ison_algebra) for consistent fake node names across subsequent plots. Re-calling to_named(ison_algebra) here can generate a different naming each time (and undermines the comparison described above). Use the existing alge object from the setup instead of re-creating it.

Suggested change
plot(node_in_structural(to_named(ison_algebra), k = 2))
plot(node_in_structural(alge, k = 2))

Copilot uses AI. Check for mistakes.
Comment on lines +527 to +528
plot(node_in_structural(to_named(ison_algebra), k = "elbow"))
plot(node_in_structural(to_named(ison_algebra), k = "silhouette"))
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

Same issue as k-discrete: since exercise.setup = "varyclust" already created alge <- to_named(ison_algebra), calling to_named(ison_algebra) again here can yield different fake names between plots/runs. Reuse alge so the elbow vs silhouette outputs are directly comparable.

Suggested change
plot(node_in_structural(to_named(ison_algebra), k = "elbow"))
plot(node_in_structural(to_named(ison_algebra), k = "silhouette"))
plot(node_in_structural(alge, k = "elbow"))
plot(node_in_structural(alge, k = "silhouette"))

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.95%. Comparing base (d1a2aa0) to head (5f1542a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #11   +/-   ##
=======================================
  Coverage   81.95%   81.95%           
=======================================
  Files          24       24           
  Lines        2394     2394           
=======================================
  Hits         1962     1962           
  Misses        432      432           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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