Skip to content

Commit

Permalink
Convert String predicate to ModuleSupplier predicate.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawalonoski committed Apr 3, 2024
1 parent 251b767 commit b44b6bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/mitre/synthea/engine/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ public static List<ModuleSupplier> getModuleSuppliers() {
* @param predicate A predicate to filter a module based on path.
* @return A list of ModuleSuppliers.
*/
public static List<ModuleSupplier> getModuleSuppliers(Predicate<String> predicate) {
public static List<ModuleSupplier> getModuleSuppliers(Predicate<ModuleSupplier> predicate) {
List<ModuleSupplier> list = new ArrayList<ModuleSupplier>();
modules.forEach((k, v) -> {

Check warning on line 265 in src/main/java/org/mitre/synthea/engine/Module.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/mitre/synthea/engine/Module.java#L264-L265

Added lines #L264 - L265 were not covered by tests
if (predicate.test(v.path)) {
if (predicate.test(v)) {
list.add(v);

Check warning on line 267 in src/main/java/org/mitre/synthea/engine/Module.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/mitre/synthea/engine/Module.java#L267

Added line #L267 was not covered by tests
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,8 @@ public static void exportMetrics() {
Path output = Paths.get(baseDir, statsDir);
output.toFile().mkdirs();

Check warning on line 112 in src/main/java/org/mitre/synthea/helpers/TransitionMetrics.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/mitre/synthea/helpers/TransitionMetrics.java#L109-L112

Added lines #L109 - L112 were not covered by tests

List<ModuleSupplier> suppliers = Module.getModuleSuppliers();
List<ModuleSupplier> suppliers = Module.getModuleSuppliers(p -> !p.core);
for (ModuleSupplier supplier : suppliers) {
if (supplier.core) {
// Java module
continue;
}
// System.out.println("Saving statistics: " + supplier.path);

Map<String, Metric> moduleMetrics = metrics.row(supplier.get().name);
Expand Down

0 comments on commit b44b6bd

Please sign in to comment.