Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No output written if output_root is specified in realization config and does not exist or is a file #848

Closed
aaraney opened this issue Jul 3, 2024 · 2 comments
Labels
question Further information is requested

Comments

@aaraney
Copy link
Member

aaraney commented Jul 3, 2024

Current behavior

If output_root is specified in a realization config and points to an existing file or a non-existent directory, NextGen does not write output.

For history sake, this feature was introduce in #531.

Expected behavior

I think this is up for debate. There is an argument for NextGen attempting to create the output directory if it does not exist, but I can also see the other side. In either case, if output_root points to a file an exception should be raised. Likewise, if the expected behavior is that NextGen attempts to create the directory but cannot for whatever reason, an exception should be raised. It is desirable that NextGen performs these checks before entering the simulation loop.

Steps to replicate behavior

Modified example realization config

realization config
{
    "global": {
      "formulations": [
        {
          "name": "bmi_c++",
          "params": {
            "model_type_name": "test_bmi_cpp",
            "library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel",
            "init_config": "./data/bmi/c/test/test_bmi_c_config.ini",
            "main_output_variable": "OUTPUT_VAR_2",
            "variables_names_map" : {
              "INPUT_VAR_2": "TMP_2maboveground",
              "INPUT_VAR_1": "precip_rate"
            },
            "uses_forcing_file": false
          }
        }
      ],
      "forcing": {
          "file_pattern": ".*{{id}}.*.csv",
          "path": "./data/forcing/"
      }
    },
    "time": {
        "start_time": "2015-12-01 00:00:00",
        "end_time": "2015-12-30 23:00:00",
        "output_interval": 3600
    },
    "output_root": "./output/"
}

Cases:

  • output_root does not exist:

    test ! -e output && \
    cmake_build/ngen data/catchment_data.geojson all data/nexus_data.geojson all above_realization_config.json && \
    test ! -e output 
  • output_root is a file:

    test ! -d output && \
    touch output && \
    test -f output && \
    cmake_build/ngen data/catchment_data.geojson all data/nexus_data.geojson all above_realization_config.json && \
    test ! -d output
@aaraney aaraney added the question Further information is requested label Jul 3, 2024
@stcui007
Copy link
Contributor

The current code appears to default the output to the project directory if output_root directory does not exist. This can end up filling the project directory with over a million files in the case of CONUS if output_root directory does not present, which makes working in the project directory very difficult.

@program-- program-- mentioned this issue Jul 18, 2024
11 tasks
@stcui007
Copy link
Contributor

stcui007 commented Aug 7, 2024

Closed via #855.

@stcui007 stcui007 closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants