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

43 decouple@main #78

Merged
merged 10 commits into from
Jun 15, 2022
Merged

43 decouple@main #78

merged 10 commits into from
Jun 15, 2022

Conversation

Polkas
Copy link
Contributor

@Polkas Polkas commented Jun 10, 2022

closes #43

Decouple metadata in the ReportCard. It is needed e.g. to support the new format method in the FilteredData class.

append_fs is expected to consume a FilteredData object now. Thus we could use the new format method.
I do not want to add teal.slice dependency so I created an artificial object for test/example purposes.

@Polkas Polkas added the core label Jun 10, 2022
@Polkas Polkas marked this pull request as ready for review June 10, 2022 07:49
@Polkas Polkas requested review from mhallal1 and kpagacz June 10, 2022 07:49
@github-actions
Copy link
Contributor

github-actions bot commented Jun 10, 2022

Unit Tests Summary

    1 files    15 suites   6s ⏱️
131 tests 131 ✔️ 0 💤 0
181 runs  181 ✔️ 0 💤 0

Results for commit 87fe53a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 10, 2022

Code Coverage Summary

Filename              Stmts    Miss  Cover    Missing
------------------  -------  ------  -------  ---------------------------------------------
R/AddCardModule.R        82       3  96.34%   73-75
R/ContentBlock.R         16       0  100.00%
R/DownloadModule.R      137      24  82.48%   76-78, 99, 156-160, 163-167, 174-178, 181-185
R/NewpageBlock.R          2       0  100.00%
R/PictureBlock.R         31       0  100.00%
R/Previewer.R           215      11  94.88%   158, 160-163, 168-174
R/Renderer.R             54       4  92.59%   142, 144-145, 166
R/ReportCard.R           30       1  96.67%   138
R/Reporter.R             43       0  100.00%
R/ResetModule.R          45       0  100.00%
R/SimpleReporter.R       18       0  100.00%
R/TableBlock.R            9       0  100.00%
R/TealReportCard.R       12       0  100.00%
R/TextBlock.R             7       0  100.00%
R/yaml_utils.R           74       2  97.30%   65, 263
TOTAL                   775      45  94.19%

Results for commit: 2ca8d9a

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@Polkas
Copy link
Contributor Author

Polkas commented Jun 13, 2022

@kpagacz and @mhallal1 I will be glad to get your feedback. I understand that we have consensus here now.

@Polkas
Copy link
Contributor Author

Polkas commented Jun 14, 2022

Do we want to transfer TealReportCard to teal here too (here remove it), as we talked.

@mhallal1 mhallal1 self-assigned this Jun 14, 2022
Co-authored-by: Mahmoud Hallal <86970066+mhallal1@users.noreply.github.com>
Copy link
Contributor

@mhallal1 mhallal1 left a comment

Choose a reason for hiding this comment

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

I am happy with the decoupling, I will approve it if @kpagacz has no additional comments.

@kpagacz kpagacz self-assigned this Jun 15, 2022
@@ -15,7 +15,7 @@ ReportCard <- R6::R6Class( # nolint: object_name_linter.
#'
initialize = function() {
private$content <- list()
private$chr_converters <- list()
private$metadata <- list()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this have duplicated keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, because of key %in% names(private$metadata)

   append_metadata = function(key, value) {
      checkmate::assert_character(key, min.len = 0, max.len = 1)
      checkmate::assert_false(key %in% names(private$metadata))

Copy link
Contributor

@kpagacz kpagacz left a comment

Choose a reason for hiding this comment

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

LGTM!

@Polkas Polkas merged commit 77c91af into main Jun 15, 2022
@Polkas Polkas deleted the 43_decouple@main branch June 15, 2022 11:51
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 ReportCard$metadata from ReportCard$content
3 participants