Skip to content

Commit

Permalink
Support daily dategrid in sunsch (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
berland authored Dec 11, 2020
1 parent 6c2179f commit c2a6d32
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
8 changes: 5 additions & 3 deletions docs/scripts/sunsch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ Features in short
- Configuration in YAML format
- Merging via DATE keyword
- Optional clipping any events before or after chosen start and end dates
- A "date grid" can be inserted. Weekly, biweekly, monthly, bimonthly and yearly
are supported. Monthly dates will be rounded to the first of every month.
- A "date grid" can be inserted. Daily, weekly, biweekly, monthly, bimonthly
and yearly are supported. Monthly dates will be rounded to the first of
every month.
- Insertion of small Schedule snippets, opening a well for example. Can
be inserted either at dates relative a reference date, or at a specific date.
- Schedule snippets can have parameters that get values when inserted.
This is similar to what one could achieve using DESIGN_KW, but with less temporary files.
This is similar to what one could achieve using DESIGN_KW, but with less
temporary files.

When to use
------------
Expand Down
2 changes: 1 addition & 1 deletion src/subscript/sunsch/sunsch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

logger = getLogger(__name__)

SUPPORTED_DATEGRIDS = ["monthly", "yearly", "weekly", "biweekly", "bimonthly"]
SUPPORTED_DATEGRIDS = ["daily", "monthly", "yearly", "weekly", "biweekly", "bimonthly"]

DESCRIPTION = """Generate Eclipse Schedule file from merges and insertions.
Expand Down
13 changes: 13 additions & 0 deletions tests/test_sunsch.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,19 @@ def test_emptyfiles(tmpdir):

def test_dategrid():
"""Test dategrid generation support in sunsch"""
# Daily
sch = sunsch.process_sch_config(
{
"startdate": datetime.date(2021, 1, 1),
"enddate": datetime.date(2022, 1, 1),
"dategrid": "daily",
}
)
assert len(sch) == 366
assert datetime.datetime(2021, 1, 1, 0, 0) in sch.dates
assert datetime.datetime(2021, 6, 6, 0, 0) in sch.dates
assert datetime.datetime(2022, 1, 1, 0, 0) in sch.dates

# Yearly
sch = sunsch.process_sch_config(
{
Expand Down

0 comments on commit c2a6d32

Please sign in to comment.