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

Decoupled scda #534

Merged
merged 29 commits into from
Jul 12, 2023
Merged

Decoupled scda #534

merged 29 commits into from
Jul 12, 2023

Conversation

kartikeyakirar
Copy link
Contributor

@kartikeyakirar kartikeyakirar commented Jul 7, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  ----------------------------------------------
R/tm_a_pca.R                    821     821  0.00%    72-1018
R/tm_a_regression.R             710     710  0.00%    92-886
R/tm_data_table.R               171     171  0.00%    58-281
R/tm_file_viewer.R              172     172  0.00%    39-241
R/tm_front_page.R               127     116  8.66%    63-205
R/tm_g_association.R            327     327  0.00%    89-475
R/tm_g_bivariate.R              652     492  24.54%   124-702, 750, 756, 760, 871, 888, 906, 926-948
R/tm_g_distribution.R          1025    1025  0.00%    110-1257
R/tm_g_response.R               346     346  0.00%    85-495
R/tm_g_scatterplot.R            716     716  0.00%    142-949
R/tm_g_scatterplotmatrix.R      278     259  6.83%    78-373, 427, 441
R/tm_missing_data.R            1034    1034  0.00%    58-1228
R/tm_outliers.R                 944     944  0.00%    76-1142
R/tm_t_crosstable.R             251     251  0.00%    81-370
R/tm_variable_browser.R         815     810  0.61%    61-1293
R/utils.R                       122     122  0.00%    74-351
R/zzz.R                           1       1  0.00%    2
TOTAL                          8512    8317  2.29%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: 137fcc7

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@m7pr m7pr self-requested a review July 11, 2023 08:03
@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2023

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  ----------------------------------------------
R/tm_a_pca.R                    828     828  0.00%    72-1024
R/tm_a_regression.R             712     712  0.00%    92-887
R/tm_data_table.R               171     171  0.00%    58-281
R/tm_file_viewer.R              172     172  0.00%    39-241
R/tm_front_page.R               127     116  8.66%    63-205
R/tm_g_association.R            331     331  0.00%    89-478
R/tm_g_bivariate.R              652     492  24.54%   124-702, 750, 756, 760, 871, 888, 906, 926-948
R/tm_g_distribution.R          1025    1025  0.00%    110-1257
R/tm_g_response.R               347     347  0.00%    85-496
R/tm_g_scatterplot.R            716     716  0.00%    160-967
R/tm_g_scatterplotmatrix.R      278     259  6.83%    78-373, 427, 441
R/tm_missing_data.R            1034    1034  0.00%    58-1228
R/tm_outliers.R                 944     944  0.00%    76-1142
R/tm_t_crosstable.R             252     252  0.00%    81-371
R/tm_variable_browser.R         815     810  0.61%    61-1293
R/utils.R                       122     122  0.00%    74-351
R/zzz.R                           1       1  0.00%    2
TOTAL                          8527    8332  2.29%

Diff against main

Filename                Stmts    Miss  Cover
--------------------  -------  ------  --------
R/tm_a_pca.R               +7      +7  +100.00%
R/tm_a_regression.R        +2      +2  +100.00%
R/tm_g_association.R       +4      +4  +100.00%
R/tm_g_response.R          +1      +1  +100.00%
R/tm_t_crosstable.R        +1      +1  +100.00%
TOTAL                     +15     +15  -0.00%

Results for commit: b071192

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2023

Unit Tests Summary

  1 files    5 suites   0s ⏱️
16 tests 16 ✔️ 0 💤 0
49 runs  49 ✔️ 0 💤 0

Results for commit 2aeceb7.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

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

Hey @kartikeyakirar I left a few general comments that I would like you to apply in multiple places. This is good enough, but requires small changes.
Also, can you put the code that you used to create datasets in dev/data-creation.R or in data-raw/data-creation.R file? And add this file to .Rbuildignore? See this section . This way we can track properties of data and we can recreate data in the future if they need slight changes

R/data.R Outdated Show resolved Hide resolved
R/tm_a_pca.R Outdated Show resolved Hide resolved
R/tm_a_pca.R Outdated Show resolved Hide resolved
R/tm_a_pca.R Show resolved Hide resolved
R/tm_a_regression.R Outdated Show resolved Hide resolved
@m7pr
Copy link
Contributor

m7pr commented Jul 11, 2023

@kartikeyakirar one more thing. Look at this PR where we decoupled scda from teal. We also decoupled teal from scda in staged.dependencies yaml. Would you do the same reverse PRs in scda and scda.2022 as in the linked PR did for teal?

@kartikeyakirar
Copy link
Contributor Author

kartikeyakirar commented Jul 11, 2023

@m7pr

Also, can you put the code that you used to create datasets in dev/data-creation.R or in data-raw/data-creation.R file? And add this file to .Rbuildignore? See this section . This way we can track properties of data and we can recreate data in the future if they need slight changes

I think the process of data creation will reintegrate SCDA dependencies, as data is stored from the SCDA package. This is consistent across all packages. However, it is worth considering the possibility of consolidating all the data into a single package. While the current approach is in use, it may be beneficial to have a discussion about centralizing the data within a specific package.

@m7pr
Copy link
Contributor

m7pr commented Jul 11, 2023

@kartikeyakirar this is fine. Just use the code and then comment it out complitely so we can track how the data was created. Can you also document the format? What are the column names and what they represent? Like here https://github.com/tidyverse/nycflights13/blob/main/R/weather.R#L7

@kartikeyakirar
Copy link
Contributor Author

kartikeyakirar commented Jul 11, 2023

I initially thought to format them but there are more or less 55 cols in ADSL itself. I don't have descriptions for all of them as well.

@m7pr
Copy link
Contributor

m7pr commented Jul 11, 2023 via email

@kartikeyakirar
Copy link
Contributor Author

@kartikeyakirar one more thing. insightsengineering/teal#858 (comment) where we decoupled scda from teal. We also decoupled teal from scda in staged.dependencies yaml. Would you do the same reverse PRs in scda and scda.2022 as in the linked PR did for teal?

Yes , for this I will raise PR along with teal.data to remove downstream dependencies.

@m7pr
Copy link
Contributor

m7pr commented Jul 11, 2023

Great, since the merge here needs to happen at the same time as for scda/scda.2022

@kartikeyakirar kartikeyakirar requested a review from m7pr July 11, 2023 11:38
@kartikeyakirar kartikeyakirar marked this pull request as draft July 11, 2023 13:59
Copy link
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

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

requested changes were not solved

@kartikeyakirar kartikeyakirar marked this pull request as ready for review July 11, 2023 15:12
@kartikeyakirar kartikeyakirar requested a review from m7pr July 11, 2023 15:21
Copy link
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

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

@kartikeyakirar a couple more minor comments.

1

Mostly, are you able to append init functions with proper package prefix teal? The same for modules/module function? In all examples? The same goes for actual usage of tm_g_* and tm_a_* functions. If they are used, are you able to append package name in front of them (teal.modules.general)?

2

One more though, are you able to rewrite examples, so that we only use rADSL and rADLB? This way we have less datasets created and we can try removing that on other packages, so that we use only those two. This is just a loos thought and I'd like your honest opinion on that.

R/tm_a_regression.R Outdated Show resolved Hide resolved
R/tm_data_table.R Outdated Show resolved Hide resolved
R/tm_front_page.R Outdated Show resolved Hide resolved
R/tm_g_bivariate.R Outdated Show resolved Hide resolved
vignettes/using-cross-table.Rmd Outdated Show resolved Hide resolved
@m7pr
Copy link
Contributor

m7pr commented Jul 12, 2023

@gogonzo @kartikeyakirar do we need to create datasets inside this package (teal.modules.general) if we actually can use the same datasets created for teal.transform? So instead of creating datasets here and calling them with teal.modules.general::rADAE, we can get rid of data here and just use teal.transform::rADAE ?

@gogonzo
Copy link
Contributor

gogonzo commented Jul 12, 2023

@m7pr @kartikeyakirar let's not make links between packages because of data. Ideally in the future most of the packages should be independent from each other and data-dependency would be another thing to decouple.

@kartikeyakirar
Copy link
Contributor Author

One more though, are you able to rewrite examples, so that we only use rADSL and rADLB? This way we have less datasets created and we can try removing that on other packages, so that we use only those two. This is just a loos thought and I'd like your honest opinion on that.

The examples were created using these datasets, and choices and selections were made accordingly. It is essential to thoroughly examine all these datasets to understand how they are used in the examples. Additionally, the RDA files' overall size was quite small, so I chose not to refactor them.

What is your thought @gogonzo? We also have eight datasets in teal.data.

R/tm_missing_data.R Outdated Show resolved Hide resolved
R/tm_missing_data.R Outdated Show resolved Hide resolved
kartikeya and others added 4 commits July 12, 2023 17:59
@kartikeyakirar kartikeyakirar requested a review from m7pr July 12, 2023 12:58
@m7pr
Copy link
Contributor

m7pr commented Jul 12, 2023

@kartikeyakirar let's leave those 5 datasets for now

Copy link
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

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

great job. team work makes the dream work

m7pr added a commit to insightsengineering/teal.transform that referenced this pull request Jul 12, 2023
A follow-up after #139 that closed #133 

After I had a chance to do a scda decoupling for goshawk
insightsengineering/goshawk#198 and had a chance
to review scda decoupling for teal.modules.general
insightsengineering/teal.modules.general#534
I realized some changes need to be applied in PRs that were already
merged in other packages.

Main changes:
- I prepend dataset names with package names as now we are having the
same data in multiple packages (`teal.transform::rADAE` and
`teal.modules.general::rADAE` for example)
- added a `data-raw/data.R` file to show how the `data/` folder was
created
- extended `.RBuildignore` file to omit `data-raw/data.R` while building
the package
@kartikeyakirar kartikeyakirar merged commit 194c9d8 into main Jul 12, 2023
24 checks passed
@kartikeyakirar kartikeyakirar deleted the decouple_scda@main branch July 12, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decouple scda from the dependencies
3 participants