Skip to content

Commit 202152e

Browse files
committed
0.9.1.0 >> 0.9.1.1
minor improvements and fixes
1 parent 0eeeadf commit 202152e

File tree

13 files changed

+336
-58
lines changed

13 files changed

+336
-58
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: entsoeapi
22
Type: Package
33
Title: An R Wrapper for the European Network of Transmission System Operators for Electricity Application Programming Interface
4-
Version: 0.9.1.0
4+
Version: 0.9.1.1
55
Authors@R: c(person("Kenneth", "Rose", role="aut", email="kennethrose82@gmail.com"),
66
person("Sándor", "Budai", role=c("aut", "cre"), email="sbudai.ga@gmail.com"))
77
Description: Simple and standardized wrappers around Entso-E API's Load, Generation,

NEWS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# entsoeapi v0.9.1.1 (2026-02-21)
2+
3+
## New functionality
4+
5+
- The beta versions of `implicit_offered_transfer_capacities()`, `explicit_offered_transfer_capacities()`, `continuous_offered_transfer_capacities()`, `flow_based_allocations()`, `auction_revenue()`, `expansion_and_dismantling_project()` and `intraday_cross_border_transfer_limits()` queries have been introduced.
6+
7+
## Miscellaneous
8+
9+
- Minor under the hood improvements and fixes.
10+
111
# entsoeapi v0.9.1.0 (2026-02-20)
212

313
## New functionality

R/en_balancing.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ utils::globalVariables(
3535
#' period_end = lubridate::ymd(x = "2024-11-01", tz = "CET"),
3636
#' tidy_output = TRUE
3737
#' )
38+
#'
3839
#' str(df)
3940
#'
4041
elastic_demands <- function(
@@ -51,15 +52,14 @@ elastic_demands <- function(
5152
tidy_output = TRUE,
5253
security_token = Sys.getenv("ENTSOE_PAT")
5354
) {
54-
5555
# check if only one eic provided
5656
if (is.null(eic)) stop("One control area EIC should be provided.")
5757
if (length(eic) > 1L) {
5858
stop("This wrapper only supports one control area EIC per request.")
5959
}
6060

6161
# check if proper process_type provided
62-
if (!process_type %in% c("A47", "A51")) {
62+
if (is.null(process_type) || !process_type %in% c("A47", "A51")) {
6363
stop("The 'process_type' should be 'A47' or 'A51'.")
6464
}
6565

@@ -247,7 +247,7 @@ exchanged_volumes <- function(
247247
}
248248

249249
# check if proper process_type provided
250-
if (!process_type %in% c("A51", "A60", "A61")) {
250+
if (is.null(process_type) || !process_type %in% c("A51", "A60", "A61")) {
251251
stop("The 'process_type' should be 'A51', 'A60' or 'A61'.")
252252
}
253253

@@ -341,7 +341,7 @@ balancing_border_cap_limit <- function(
341341
# check if only one in and only one out eic provided
342342
if (is.null(eic_in)) stop("One 'in' control area EIC should be provided.")
343343
if (is.null(eic_out)) stop("One 'out' control area EIC should be provided.")
344-
if (length(eic_in) > 1 || length(eic_out) > 1) {
344+
if (length(eic_in) > 1L || length(eic_out) > 1L) {
345345
stop("This wrapper only supports one in and one out EIC per request.")
346346
}
347347

R/en_market.R

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -394,32 +394,6 @@ flow_based_allocations <- function(
394394

395395

396396

397-
# 4.2.6. Explicit Allocations (Use of the Transfer Capacity) [12.1.A]
398-
# 100 documents limit applies
399-
# Minimum time interval in query response ranges from part of day to year,
400-
# depending on selected Contract_MarketAgreement.Type
401-
# Mandatory parameters:
402-
# - DocumentType
403-
# - BusinessType
404-
# - Contract_MarketAgreement.Type
405-
# - In_Domain
406-
# - Out_Domain
407-
# - TimeInterval or combination of PeriodStart and PeriodEnd
408-
# Optional parameters:
409-
# - Auction.Category
410-
# - ClassificationSequence_AttributeInstanceComponent.Position
411-
# GET /api?documentType=A25
412-
# &businessType=B05
413-
# &contract_MarketAgreement.Type=A01
414-
# &in_Domain=10YSK-SEPS-----K
415-
# &out_Domain=10YCZ-CEPS-----N
416-
# &auction.Category=A01
417-
# &classificationSequence_AttributeInstanceComponent.Position=1
418-
# &periodStart=201601012300
419-
# &periodEnd=201601022300
420-
421-
422-
423397
#' @title
424398
#' Get the Auction Revenue (12.1.A)
425399
#'
@@ -463,15 +437,15 @@ flow_based_allocations <- function(
463437
#' str(df)
464438
#'
465439
auction_revenue <- function(
466-
eic_in = NULL,
467-
eic_out = NULL,
468-
period_start = lubridate::ymd(Sys.Date() - lubridate::days(x = 1L),
469-
tz = "CET"),
470-
period_end = lubridate::ymd(Sys.Date(),
440+
eic_in = NULL,
441+
eic_out = NULL,
442+
period_start = lubridate::ymd(Sys.Date() - lubridate::days(x = 1L),
471443
tz = "CET"),
472-
contract_type = "A01",
473-
tidy_output = FALSE,
474-
security_token = Sys.getenv("ENTSOE_PAT")
444+
period_end = lubridate::ymd(Sys.Date(),
445+
tz = "CET"),
446+
contract_type = "A01",
447+
tidy_output = FALSE,
448+
security_token = Sys.getenv("ENTSOE_PAT")
475449
) {
476450
# check if only one eic provided
477451
if (is.null(eic_in)) stop("One 'in' control area EIC should be provided.")
@@ -806,10 +780,6 @@ day_ahead_prices <- function(
806780

807781

808782

809-
# Implicit Allocations - Net positions @@@@
810-
# Intraday Implicit Allocations - Congestion Income @@@@
811-
# Daily Implicit Allocations - Congestion Income @@@@
812-
# Daily Flow Based Allocations - Congestion Income @@@@
813783
# 4.2.11. Implicit Auction — Net Positions [12.1.E]
814784
# One year range limit applies
815785
# Minimum time interval in query response is one day
@@ -857,7 +827,6 @@ day_ahead_prices <- function(
857827

858828

859829
# Transfer Capacities Allocated with Third Countries (Implicit)
860-
# Transfer Capacities Allocated with Third Countries
861830
# 4.2.16. Capacity Allocated Outside EU [12.1.H] @@@@
862831
# 100 documents limit applies
863832
# Minimum time interval in query response ranges from part of day to year,

R/en_outages.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ outages_fallbacks <- function(
750750
# check if valid event_nature provided
751751
if (!event_nature %in% c("C47", "A53", "A54", "A83")) {
752752
stop("The 'event_nature' parameter should be ",
753-
"'C47', 'A53', 'A54' or '83'.")
753+
"'C47', 'A53', 'A54' or 'A83'.")
754754
}
755755

756756
# check if valid security token is provided

R/en_transmission.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ expansion_and_dismantling_project <- function(
7676
# check if business_type value is valid
7777
if (isFALSE(business_type %in% c("B01", "B02"))) {
7878
stop(
79-
"The 'doc_status' parameter should be 'B01', 'B02'."
79+
"The 'business_type' parameter should be 'B01', 'B02'."
8080
)
8181
}
8282

8383
# check if doc_status value is valid
8484
if (isFALSE(doc_status %in% c("A01", "A02", "A05", "A09", "A13", "X01"))) {
8585
stop(
86-
"The 'doc_status' parameter should be 'A01', 'A02'",
86+
"The 'doc_status' parameter should be 'A01', 'A02' ",
8787
"A05', 'A09', 'A13' or 'X01'."
8888
)
8989
}
@@ -99,8 +99,8 @@ expansion_and_dismantling_project <- function(
9999
"&out_Domain=", eic_out,
100100
"&periodStart=", period_start,
101101
"&periodEnd=", period_end,
102-
"&=businessType", business_type,
103-
"&=DocStatus", doc_status
102+
"&businessType=", business_type,
103+
"&DocStatus=", doc_status
104104
)
105105

106106
# send GET request

R/utils.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,10 +1257,7 @@ add_type_names <- function(tbl) {
12571257
definition_name = "ts_auction_type_def"
12581258
)
12591259
}
1260-
if (
1261-
"subject_market_participant_market_role_type"
1262-
%in% names(tbl)
1263-
) {
1260+
if ("subject_market_participant_market_role_type" %in% names(tbl)) {
12641261
affected_cols <- c(
12651262
affected_cols,
12661263
"subject_market_participant_market_role_type"

man/elastic_demands.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-en_balancing.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ testthat::test_that(
44
testthat::expect_no_error(
55
object = elastic_demands(
66
eic = "10YCZ-CEPS-----N",
7-
process_type = "A47",
87
period_start = lubridate::ymd(
98
x = "2024-01-01",
109
tz = "CET"
@@ -13,10 +12,15 @@ testthat::test_that(
1312
x = "2024-12-01",
1413
tz = "CET"
1514
),
15+
process_type = "A47",
1616
tidy_output = TRUE
1717
),
1818
message = "uses offsetting"
1919
) |>
20+
testthat::expect_warning() |>
21+
testthat::expect_warning() |>
22+
testthat::expect_warning() |>
23+
testthat::expect_warning() |>
2024
testthat::expect_warning()
2125
testthat::expect_no_error(
2226
object = elastic_demands(

tests/testthat/test-en_helpers.R

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,150 @@ testthat::test_that(
5858
)
5959
}
6060
)
61+
62+
63+
64+
testthat::test_that(
65+
desc = "party_eic() works",
66+
code = {
67+
testthat::expect_no_error(object = party_eic())
68+
testthat::expect_error(
69+
object = party_eic("foo"),
70+
info = "Error in party_eic('foo') : unused argument ('foo')"
71+
)
72+
tbl <- party_eic()
73+
testthat::expect_s3_class(object = tbl, class = "tbl_df", exact = FALSE)
74+
testthat::expect_gt(object = nrow(tbl), expected = 0L)
75+
testthat::expect_contains(
76+
object = names(tbl),
77+
expected = c("EicCode", "EicLongName", "type")
78+
)
79+
testthat::expect_true(object = all(tbl$type == "X"))
80+
}
81+
)
82+
83+
84+
85+
testthat::test_that(
86+
desc = "area_eic() works",
87+
code = {
88+
testthat::expect_no_error(object = area_eic())
89+
testthat::expect_error(
90+
object = area_eic("foo"),
91+
info = "Error in area_eic('foo') : unused argument ('foo')"
92+
)
93+
tbl <- area_eic()
94+
testthat::expect_s3_class(object = tbl, class = "tbl_df", exact = FALSE)
95+
testthat::expect_gt(object = nrow(tbl), expected = 0L)
96+
testthat::expect_contains(
97+
object = names(tbl),
98+
expected = c("EicCode", "EicLongName", "type")
99+
)
100+
testthat::expect_true(object = all(tbl$type == "Y"))
101+
}
102+
)
103+
104+
105+
106+
testthat::test_that(
107+
desc = "accounting_point_eic() works",
108+
code = {
109+
testthat::expect_no_error(object = accounting_point_eic())
110+
testthat::expect_error(
111+
object = accounting_point_eic("foo"),
112+
info = "Error in accounting_point_eic('foo') : unused argument ('foo')"
113+
)
114+
tbl <- accounting_point_eic()
115+
testthat::expect_s3_class(object = tbl, class = "tbl_df", exact = FALSE)
116+
testthat::expect_gt(object = nrow(tbl), expected = 0L)
117+
testthat::expect_contains(
118+
object = names(tbl),
119+
expected = c("EicCode", "EicLongName", "type")
120+
)
121+
testthat::expect_true(object = all(tbl$type == "Z"))
122+
}
123+
)
124+
125+
126+
127+
testthat::test_that(
128+
desc = "tie_line_eic() works",
129+
code = {
130+
testthat::expect_no_error(object = tie_line_eic())
131+
testthat::expect_error(
132+
object = tie_line_eic("foo"),
133+
info = "Error in tie_line_eic('foo') : unused argument ('foo')"
134+
)
135+
tbl <- tie_line_eic()
136+
testthat::expect_s3_class(object = tbl, class = "tbl_df", exact = FALSE)
137+
testthat::expect_gt(object = nrow(tbl), expected = 0L)
138+
testthat::expect_contains(
139+
object = names(tbl),
140+
expected = c("EicCode", "EicLongName", "type")
141+
)
142+
testthat::expect_true(object = all(tbl$type == "T"))
143+
}
144+
)
145+
146+
147+
148+
testthat::test_that(
149+
desc = "location_eic() works",
150+
code = {
151+
testthat::expect_no_error(object = location_eic())
152+
testthat::expect_error(
153+
object = location_eic("foo"),
154+
info = "Error in location_eic('foo') : unused argument ('foo')"
155+
)
156+
tbl <- location_eic()
157+
testthat::expect_s3_class(object = tbl, class = "tbl_df", exact = FALSE)
158+
testthat::expect_gt(object = nrow(tbl), expected = 0L)
159+
testthat::expect_contains(
160+
object = names(tbl),
161+
expected = c("EicCode", "EicLongName", "type")
162+
)
163+
testthat::expect_true(object = all(tbl$type == "V"))
164+
}
165+
)
166+
167+
168+
169+
testthat::test_that(
170+
desc = "resource_object_eic() works",
171+
code = {
172+
testthat::expect_no_error(object = resource_object_eic())
173+
testthat::expect_error(
174+
object = resource_object_eic("foo"),
175+
info = "Error in resource_object_eic('foo') : unused argument ('foo')"
176+
)
177+
tbl <- resource_object_eic()
178+
testthat::expect_s3_class(object = tbl, class = "tbl_df", exact = FALSE)
179+
testthat::expect_gt(object = nrow(tbl), expected = 0L)
180+
testthat::expect_contains(
181+
object = names(tbl),
182+
expected = c("EicCode", "EicLongName", "type")
183+
)
184+
testthat::expect_true(object = all(tbl$type == "W"))
185+
}
186+
)
187+
188+
189+
190+
testthat::test_that(
191+
desc = "substation_eic() works",
192+
code = {
193+
testthat::expect_no_error(object = substation_eic())
194+
testthat::expect_error(
195+
object = substation_eic("foo"),
196+
info = "Error in substation_eic('foo') : unused argument ('foo')"
197+
)
198+
tbl <- substation_eic()
199+
testthat::expect_s3_class(object = tbl, class = "tbl_df", exact = FALSE)
200+
testthat::expect_gt(object = nrow(tbl), expected = 0L)
201+
testthat::expect_contains(
202+
object = names(tbl),
203+
expected = c("EicCode", "EicLongName", "type")
204+
)
205+
testthat::expect_true(object = all(tbl$type == "A"))
206+
}
207+
)

0 commit comments

Comments
 (0)