@@ -82,7 +82,8 @@ test_that("for a company with 3 products of varying footprints, value is 1/3 (#2
8282 )
8383
8484 product <- emissions_profile_any_at_product_level(companies , inputs , low_threshold , high_threshold )
85- out <- epa_at_company_level(product )
85+ out <- epa_at_company_level(product ) | >
86+ filter(grouped_by != " input_unit_input_isic_4digit" )
8687 expect_true(identical(unique(out $ value ), expected_value ))
8788})
8889
@@ -136,7 +137,8 @@ test_that("in each benchmark, `profile_ranking` increases with `*co2_footprint`"
136137 companies <- example_companies()
137138 co2 <- example_inputs(input_co2_footprint = - 1 : 1 )
138139
139- out <- unnest_product(emissions_profile_upstream(companies , co2 ))
140+ out <- unnest_product(emissions_profile_upstream(companies , co2 )) | >
141+ filter(grouped_by != " input_unit_input_isic_4digit" )
140142
141143 in_all_benchmarks_profile_ranking_increases_with_co2_footprint <- out | >
142144 group_by(grouped_by ) | >
@@ -222,7 +224,8 @@ test_that("at company level, with two matched products and `NA` in one benchmark
222224 )
223225
224226 out <- emissions_profile_upstream(companies , co2 ) | >
225- unnest_company()
227+ unnest_company() | >
228+ filter(grouped_by != " input_unit_input_isic_4digit" )
226229 # expect `0.5` where `risk_category` is `NA`
227230 out | >
228231 filter(grepl(benchmark , grouped_by )) | >
@@ -254,7 +257,8 @@ test_that("at company level, `NA` in the benchmark of 1/3 products yields a `val
254257 )
255258
256259 out <- emissions_profile_upstream(companies , co2 ) | >
257- unnest_company()
260+ unnest_company() | >
261+ filter(grouped_by != " input_unit_input_isic_4digit" )
258262 # expect `1/3` where `risk_category` is `NA`
259263 out | >
260264 filter(grepl(benchmark , grouped_by )) | >
@@ -427,6 +431,7 @@ test_that("at company level, 1 matched product yields `value = 1` in 1 `risk_cat
427431
428432 out <- emissions_profile_upstream(companies , co2 ) | >
429433 unnest_company() | >
434+ filter(grouped_by != " input_unit_input_isic_4digit" ) | >
430435 distinct(risk_category , value ) | >
431436 pull(value )
432437
@@ -443,6 +448,7 @@ test_that("at company level, 2 matched products yield `value = 1` in 1 `risk_cat
443448
444449 out <- emissions_profile_upstream(companies , co2 ) | >
445450 unnest_company() | >
451+ filter(grouped_by != " input_unit_input_isic_4digit" ) | >
446452 distinct(risk_category , value ) | >
447453 pull(value )
448454
@@ -457,6 +463,7 @@ test_that("at company level, one matched and one unmatched products yield `value
457463
458464 out <- emissions_profile_upstream(companies , co2 ) | >
459465 unnest_company() | >
466+ filter(grouped_by != " input_unit_input_isic_4digit" ) | >
460467 distinct(risk_category , value )
461468
462469 na <- pull(filter(out , is.na(risk_category )), value )
@@ -473,6 +480,7 @@ test_that("at company level, two matched and one unmatched products yield `value
473480
474481 out <- emissions_profile_upstream(companies , co2 ) | >
475482 unnest_company() | >
483+ filter(grouped_by != " input_unit_input_isic_4digit" ) | >
476484 distinct(risk_category , value )
477485
478486 na <- pull(filter(out , is.na(risk_category )), value )
@@ -491,7 +499,8 @@ test_that("at company level, three products with different `co2_footprint` yield
491499 !! aka(" ico2footprint" ) : = 1 : 3 ,
492500 )
493501
494- out <- emissions_profile_upstream(companies , co2 ) | > unnest_company()
502+ out <- emissions_profile_upstream(companies , co2 ) | > unnest_company()| >
503+ filter(grouped_by != " input_unit_input_isic_4digit" )
495504
496505 actual <- out | >
497506 filter(value != 0 ) | >
@@ -546,6 +555,7 @@ test_that("at company level, 1 matched product, one missing benchmark, and one u
546555
547556 isic <- emissions_profile_upstream(companies , co2 ) | >
548557 unnest_company() | >
558+ filter(grouped_by != " input_unit_input_isic_4digit" ) | >
549559 filter(grepl(aka(" iisic" ), grouped_by )) | >
550560 distinct(risk_category , value )
551561
0 commit comments