Skip to content

Conversation

Perro2110
Copy link
Member

I'm opening this PR as indicated to evaluate together the possible contribution of this code, which through the refine_dnf function aims to minimize the number of disjuncts within a DNF by evaluating the domains of the features contained in it.

@Perro2110 Perro2110 requested a review from giopaglia August 19, 2025 22:14
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

❌ Patch coverage is 0% with 180 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (FromForeststoMinimalFormulasALogic-DrivenFrameworktoExplainEnsembleModels@a24ff7a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/scalar/dnf-domain-minimization.jl 0.00% 180 Missing ⚠️
Additional details and impacted files
@@                                             Coverage Diff                                              @@
##             FromForeststoMinimalFormulasALogic-DrivenFrameworktoExplainEnsembleModels      #50   +/-   ##
============================================================================================================
  Coverage                                                                             ?   46.80%           
============================================================================================================
  Files                                                                                ?       52           
  Lines                                                                                ?     3596           
  Branches                                                                             ?        0           
============================================================================================================
  Hits                                                                                 ?     1683           
  Misses                                                                               ?     1913           
  Partials                                                                             ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…nused configuration parameter (which was used in the old test mode)
… name: "Submodule for datasets #41"

- Added new dependencies to Project.toml: DataFrames and Pkg.
- Removed the obsolete espresso file.
- Enhanced the minimize.jl file with improved comments and artifact loading logic.
- Created artifactloader.jl to manage artifact downloads and extraction.
- Implemented loader.jl to automate the generation of Artifacts.toml.
- Added Artifacts.toml with necessary artifact entries for ABC and MITESPRESSO.
Comment on lines +42 to +44
@show espressoPath
espressobinary = joinpath(espressoPath, "espresso")
@show espressobinary
Copy link
Member

Choose a reason for hiding this comment

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

Avoid @show if we want to print something for the user; let's remove these or use println statements as usual. We could probably also have a silent::Bool kwarg to suppress any output.

"""
function fill_artifacts(url::String)
Completely automatize the insertion of a new resource into the Artifacts.toml file.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Completely automatize the insertion of a new resource into the Artifacts.toml file.
Automatate the insertion of a new resource into the Artifacts.toml file.

end

"""
function fill_artifacts(url::String)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
function fill_artifacts(url::String)
fill_artifacts(url::String)

Comment on lines +39 to +42
artifact_loader(::Any) = @error "No artifact_loader method written for generic type"
artifact_loader(::AbstractLoader) = @error "No artifact_loader method written for generic AbstractLoader type"
artifact_loader(::AbstractLoaderDataset) = @error "No artifact_loader method written for generic AbstractLoaderDataset type"
artifact_loader(::AbstractLoaderBinary) = @error "No artifact_loader method written for generic AbstractLoaderBinary type"
Copy link
Member

Choose a reason for hiding this comment

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

A single implementation is enough:

Suggested change
artifact_loader(::Any) = @error "No artifact_loader method written for generic type"
artifact_loader(::AbstractLoader) = @error "No artifact_loader method written for generic AbstractLoader type"
artifact_loader(::AbstractLoaderDataset) = @error "No artifact_loader method written for generic AbstractLoaderDataset type"
artifact_loader(::AbstractLoaderBinary) = @error "No artifact_loader method written for generic AbstractLoaderBinary type"
artifact_loader(loader::Any) = @error "No artifact_loader method written for loader of type `$(typeof(loader))`"

I would also switch from artifact_loader to artifact.

Comment on lines +8 to +9
abstract type AbstractLoaderDataset <: AbstractLoader end
abstract type AbstractLoaderBinary <: AbstractLoader end
Copy link
Member

Choose a reason for hiding this comment

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

Let's avoid hypertyping if we don't need to, these are not strictly needed.

abstract type AbstractLoaderDataset <: AbstractLoader end
abstract type AbstractLoaderBinary <: AbstractLoader end

struct ABCLoaderBinary <: AbstractLoaderBinary
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
struct ABCLoaderBinary <: AbstractLoaderBinary
struct ABCBinaryLoader <: AbstractLoaderBinary

Copy link
Member

Choose a reason for hiding this comment

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

Same for MITESPRESSO, seems more readable like this

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

Successfully merging this pull request may close these issues.

2 participants