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

AzimuthReference cannot run correctly in jupyter when generate my own reference #27

Open
Dthbca opened this issue Dec 2, 2024 · 0 comments

Comments

@Dthbca
Copy link

Dthbca commented Dec 2, 2024

I got this when run AzimuthReference:

Error in ValidateAzimuthReference(object = object): Reference must contain an AzimuthData object in the tools slot.
Traceback:

1. ValidateAzimuthReference(object = object)
2. stop("Reference must contain an AzimuthData object in the tools slot.")
3. .handleSimpleError(function (cnd) 
 . {
 .     watcher$capture_plot_and_output()
 .     cnd <- sanitize_call(cnd)
 .     watcher$push(cnd)
 .     switch(on_error, continue = invokeRestart("eval_continue"), 
 .         stop = invokeRestart("eval_stop"), error = invokeRestart("eval_error", 
 .             cnd))
 . }, "Reference must contain an AzimuthData object in the tools slot.", 
 .     base::quote(ValidateAzimuthReference(object = object)))

After check the code, i found that the tools slot haven't changed correctly due to this part of the function AzimuthReference:

  tool.name <- as.character(x = sys.calls())
  tool.name <- lapply(
    X = strsplit(x = tool.name, split = "(", fixed = TRUE), 
    FUN = "[", 
    1
  )[[1]]
  if (tool.name != "AzimuthReference") {
    slot(object, name = "tools")["AzimuthReference"] <- slot(object, name = "tools")[tool.name]
    slot(object, name = "tools")[tool.name] <- NULL
  }

which make object@tools$AzimuthReference change to NULL

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

No branches or pull requests

1 participant