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

[BUG] Warning in chart-function when using namespace qualified function calls #13

Closed
serkor1 opened this issue Jun 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@serkor1
Copy link
Owner

serkor1 commented Jun 5, 2024

When using pkg::foo() the chart()-function throws a warning. See below,

Function calls

# 1) load library
# and define data for
# MWE
library(cryptoQuotes)

ticker  <- cryptoQuotes:::control_data$quote
lsratio <- cryptoQuotes:::control_data$lsratio

# 2) chart with 
# function calls
chart(
  ticker = ticker,
  main   = kline(),
  sub = list(
    volume()
  )
)

Namespace qualified function calls

# 3) chart with 
# namespace qualified
# function calls
cryptoQuotes::chart(
  ticker = ticker,
  main   = cryptoQuotes::kline(),
  sub = list(
    cryptoQuotes::volume()
  )
)
#> Warning in call_stack == calling_function: longer object length is not a
#> multiple of shorter object length
#> Warning in call_stack == calling_function: longer object length is not a
#> multiple of shorter object length

Created on 2024-06-05 with reprex v2.1.0

Note to self

  • This warning wouldn't get caught in the test-environment as all tests uses function calls, however all related tests should be wrapped in testthat::expect_no_condition() either way.

  • There is no legend in either example

@serkor1 serkor1 added the bug Something isn't working label Jun 5, 2024
@serkor1 serkor1 self-assigned this Jun 5, 2024
serkor1 added a commit that referenced this issue Jun 25, 2024
This commit closes #13 🚀

Additional Fix:

The random sampling of tickers in the kraken-tests forced the failure of the tests. A seed of 1903 has been added to each unit test.

Added test indicators on the get_quote unit tests as it would fail for Bitmart in the 1h. This is due to a rounding error; this requires further investigation at a later point.

The chart unittests has been updated to make sure it runs without any conditions at all to avoid the same errors as in #13.

Note:

All checks have passed locally, and NEWS.md has been updated accordingly
@serkor1 serkor1 closed this as completed Jun 25, 2024
serkor1 added a commit that referenced this issue Jun 28, 2024
* Fixed Bugs and Updated Tests

This commit closes #13 🚀

Additional Fix:

The random sampling of tickers in the kraken-tests forced the failure of the tests. A seed of 1903 has been added to each unit test.

Added test indicators on the get_quote unit tests as it would fail for Bitmart in the 1h. This is due to a rounding error; this requires further investigation at a later point.

The chart unittests has been updated to make sure it runs without any conditions at all to avoid the same errors as in #13.

Note:

All checks have passed locally, and NEWS.md has been updated accordingly

* Chart layout changes 🚀

The chart now has a higher top-margin to prevent modebar from overlaying the title and subtitle.

The modebar now includes drawrect, drawline and eraseshape to create and remove support and resistance lines.

The chart title and subtitle can also be customized interactively. See Discussion #19

All charts are now exported in 4k as .svg-files.

The modebar is always visible by default, but can be removed within the options.

The charts now has custom color-palettes via hcl.pals()

Known Issues:

The exported charts has really small font sizes, so it is barely visible.

* Update Chart Options 😍

The chart-function now has the following options:

* scale: scales the font-size.
* static: a logical value FALSE by default. If TRUE it act as a regular static plot a la ggplot.

The chart function now asserts the size being between 0 and 1, and checks for valid hcl.palettes with ignore.case set to TRUE.

All subcharts have had annotations multiplied by args from the chart funciton.

NOTE: All checks have passed locally 🚀
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant