equinor / flownet

FlowNet - Data-Driven Reservoir Predictions
GNU General Public License v3.0
63 stars 29 forks source link

corrects a time shift in the FlowNet schedule relative to data #308

Closed olwijn closed 3 years ago

olwijn commented 3 years ago

Insert a description of your pull request (PR) here, and check off the boxes below when they are done.


Contributor checklist

wouterjdb commented 3 years ago

CI/CD failing?

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.6/x64/bin/flownet", line 33, in <module>
    sys.exit(load_entry_point('flownet==0.1.dev1+g561b292', 'console_scripts', 'flownet')())
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/flownet/_command_line.py", line 274, in main
    args.func(args)
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/flownet/_command_line.py", line 95, in flownet_pred
    run_flownet_prediction(config, args)
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/flownet/prediction/_run_pred.py", line 35, in run_flownet_prediction
    create_ert_setup(
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/flownet/ert/_create_ert_setup.py", line 210, in create_ert_setup
    if hasattr(config.ert, "analysis"):
AttributeError: 'list' object has no attribute 'ert'
olelod commented 3 years ago

I wonder if we will not get the same result by simply moving

{%- if date > startdate: %}
DATES
 {{ date.strftime('%d %b %Y').upper() }} /
/
{%- endif %}

in the template file HISTORY_SCHEDULE.inc.jinja2 to the end of the for loop instead of the beginning.

https://github.com/equinor/flownet/blob/master/src/flownet/templates/HISTORY_SCHEDULE.inc.jinja2#L2 to https://github.com/equinor/flownet/blob/master/src/flownet/templates/HISTORY_SCHEDULE.inc.jinja2#L47

This will also move the WELSPECS and COMPDAT keywords, but new wells seems to always be introduced with 'STOP' in WCONHIST (which are removed in your PR, right?).

olwijn commented 3 years ago

@olelod A quick test suggests that you are right, this is a much smarter solution.