Skip to content

refactor!: New arpack_defaults() replaces igraph.arpack.default and arpack_defaults lists#800

Merged
aviator-app[bot] merged 9 commits intoigraph:mainfrom
maelle:byebyelists
Nov 13, 2023
Merged

refactor!: New arpack_defaults() replaces igraph.arpack.default and arpack_defaults lists#800
aviator-app[bot] merged 9 commits intoigraph:mainfrom
maelle:byebyelists

Conversation

@maelle
Copy link
Copy Markdown
Contributor

@maelle maelle commented May 16, 2023

…arpack_defaults() as a function

Like #762
Fix #714

@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented May 16, 2023

@krlmlr how can I add this change (changing the default argument but also doing the "hack" inside the function to not break reverse dependencies) to functions of aaa-auto.R?

@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented May 20, 2023

Can you please rephrase?

The checks are failing here.

@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented May 22, 2023

I have made changes in some scripts manually. For the checks to pass, I'd need to update aaa-auto.R. However I do not know how to do that not manually. I know where aaa-auto.R content comes from but

  • the "hack" with rlang is a bit longer than what's in the YAML files.
  • I don't know how to update aaa-auto.R based on the YAML file.

@ntamas
Copy link
Copy Markdown
Member

ntamas commented Jun 5, 2023

aaa-auto.R is generated from tools/stimulus/aaa-auto.R.in (which is basically empty) using Stimulus. I think it might be easier if you could simply show what you'd like to do in aaa-auto.R and then I can tell you what the easiest option would be.

@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented Jun 16, 2023

For functions that have arpack_defaults as a default argument value, I need to change it to arpack_defaults(), but also to add these lines at the top of the function body

  eval_try <- rlang::eval_tidy(options)
  options_value <- rlang::call_args(rlang::current_call())[["options"]]
  if (is(eval_try, "function") && as.character(options_value) == "arpack_defaults") {
    lifecycle::deprecate_soft(
      "1.5.0",
      I("arpack_defaults"),
      "arpack_defaults()",
      details = c("So the function arpack_defaults(), not an object called arpack_defaults.")
    )
    options <- arpack_defaults()
  }

I'll explore a bit more.

Copy link
Copy Markdown
Contributor

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

Thanks. Some functions still seem to use igraph.arpack.default, according to check results?

Comment thread R/centrality.R
arpack <- function(func, extra = NULL, sym = FALSE, options = arpack_defaults(),
env = parent.frame(), complex = !sym) {

eval_try <- rlang::eval_tidy(options)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why eval_tidy()? We should be able to do this with standard evaluation, forcing should be enough?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do you have any example I could look at?

Comment thread R/centrality.R Outdated
options_value <- rlang::call_args(rlang::current_call())[["options"]]
if (is(eval_try, "function") && as.character(options_value) == "arpack_defaults") {
lifecycle::deprecate_soft(
"1.5.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Numbers are cheap.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

what do you mean?

@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented Jun 20, 2023

yes because I'm stuck, not knowing how to add the lines to the body of functions that are created automatically #800 (comment) (I won't get back to this this week)

@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Jun 20, 2023

Oh, got you. Instead of changing the body of an autogenerated function, can we wrap it instead, as done in #859?

@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented Jun 29, 2023

In this PR I have updated types-RR.yaml, however running the makefile doesn't update aaa-auto.R, I am confused.

@krlmlr good idea, will do.

@ntamas
Copy link
Copy Markdown
Member

ntamas commented Jun 29, 2023

In this PR I have updated types-RR.yaml, however running the makefile doesn't update aaa-auto.R, I am confused.

Are you running Makefile-cigraph? This is the makefile that contains the rule that updates aaa-auto.R.

@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented Jul 13, 2023

I ran make -f Makefile-cigraph src/rinterface.c R/aaa-auto.R as indicated in tools/README.md

@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented Jul 13, 2023

But maybe I should use other arguments actually? Could that be documented in that README? I'd happily test the instructions. 😸

Copy link
Copy Markdown
Contributor

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

I'll tweak here too.

@aviator-app
Copy link
Copy Markdown
Contributor

aviator-app Bot commented Nov 10, 2023

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.

Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@aviator-app aviator-app Bot force-pushed the byebyelists branch 8 times, most recently from cb782d9 to 4931c9c Compare November 11, 2023 06:40
@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Nov 11, 2023

@maelle: Can you please take a look at the failing tests? Do you need more support?

@aviator-app aviator-app Bot force-pushed the byebyelists branch 2 times, most recently from 784ba24 to 73b2501 Compare November 12, 2023 01:41
@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented Nov 13, 2023

My problems here are

@krlmlr krlmlr marked this pull request as ready for review November 13, 2023 13:44
@krlmlr krlmlr changed the title refactor!: kill igraph.arpack.default and arpack_defaults lists, add … refactor!: New arpack_defaults() replaces igraph.arpack.default and arpack_defaults lists Nov 13, 2023
@maelle
Copy link
Copy Markdown
Contributor Author

maelle commented Nov 13, 2023

thanks @krlmlr

@aviator-app aviator-app Bot merged commit 823f935 into igraph:main Nov 13, 2023
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

special case the lifecycle transformation of igraph.arpack.default

3 participants