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

Register data per application and allow arbitrary registration #29143

Merged
merged 36 commits into from
Dec 2, 2024

Conversation

loganharbour
Copy link
Member

@loganharbour loganharbour commented Nov 26, 2024

Closes #29141

Summary:

  • Enables the association of data file directories with a name, so that you can (1) query the directories by name, (2) resolve ambiguities when data is found in multiple places, (3) output this information in a readable way
  • Removes the need to call DataFileInterface::getDataFileName("param") and instead sets the param value internally so that getParam<DataFileName>("param") gets you the absolute path to whatever we searched

You can directly query an application's registered data path with:

Registry::getDataPath("griffin");

In the event that you have ambiguous data, you'll get an error like the following (where you can provide name:path/to/file to be explicit)

*** ERROR ***
CLI_ARGS:1: (UserObjects/data_file/data_file) Multiple files were found when searching for the data file 'file':

  moose: /path/to/data/file
  other: /path/to/data/file

You can resolve this ambiguity by appending a prefix with the desired data name, for example:

  moose:file

In the event that you're searching from a parameter (you have a base to search from) and nothing is found, you get a useful printout of everything searched, like:

*** ERROR ***
CLI_ARGS:1: (UserObjects/data_file/data_file) Unable to find the data file 'file' anywhere.

Paths searched:

  moose data: /path/to/data
  working directory: /path/to/input/base

The command line options --show-data-params and --show-data-paths were added so that you can see this info in the header (because we no longer call mooseInfo() every time we resolve params because it would be too verbose):

Data File Paths:
  moose: /data/harblh/projects/griffin/moose/framework/data

Data File Parameters:
  UserObjects/data_file/data_file = /data/harblh/projects/griffin/moose/framework/data/README.md

If the search path starts with ./ it will not search data directories, and you'll get information that this is the case:

CLI_ARGS:1: (UserObjects/data_file/data_file) Unable to find the data file './file' anywhere.

Paths searched:

  working directory: /path/to/input/base

Data path(s) were not searched because search path begins with './'

and the same for when the search path resolves outside of .:

CLI_ARGS:1: (UserObjects/data_file/data_file) Unable to find the data file '../file' anywhere.

Paths searched:

  working directory: /path/to/input/base

Data path(s) were not searched because search path resolves behind '.'

You can interact directly with the registry to get files (like needed for the NEML case) with:

Moose::DataFileUtils::getPathExplicit("bison", "path/to/data");

@loganharbour loganharbour force-pushed the data_better branch 6 times, most recently from b07f365 to 9ecf648 Compare November 26, 2024 03:05
@moosebuild
Copy link
Contributor

moosebuild commented Nov 26, 2024

Job Documentation, step Docs: sync website on 783ba06 wanted to post the following:

View the site here

This comment will be updated on new commits.

@loganharbour loganharbour force-pushed the data_better branch 2 times, most recently from 0a4dfa7 to 536b0b8 Compare November 26, 2024 18:41
@loganharbour loganharbour marked this pull request as ready for review November 26, 2024 18:43
@moosebuild
Copy link
Contributor

moosebuild commented Nov 26, 2024

Job Coverage, step Generate coverage on 783ba06 wanted to post the following:

Framework coverage

cedfd0 #29143 783ba0
Total Total +/- New
Rate 85.14% 85.16% +0.02% 96.63%
Hits 107658 107813 +155 201
Misses 18792 18792 - 7

Diff coverage report

Full coverage report

Modules coverage

Chemical reactions

cedfd0 #29143 783ba0
Total Total +/- New
Rate 92.65% 92.62% -0.03% -
Hits 1501 1507 +6 0
Misses 119 120 +1 0

Diff coverage report

Full coverage report

Contact

cedfd0 #29143 783ba0
Total Total +/- New
Rate 90.38% 90.38% +0.01% -
Hits 4959 4963 +4 0
Misses 528 528 - 0

Diff coverage report

Full coverage report

Fluid properties

cedfd0 #29143 783ba0
Total Total +/- New
Rate 85.20% 85.19% -0.01% -
Hits 7777 7777 - 0
Misses 1351 1352 +1 0

Diff coverage report

Full coverage report

Heat transfer

cedfd0 #29143 783ba0
Total Total +/- New
Rate 88.81% 88.81% -0.01% -
Hits 4406 4411 +5 0
Misses 555 556 +1 0

Diff coverage report

Full coverage report

Navier stokes

cedfd0 #29143 783ba0
Total Total +/- New
Rate 84.82% 84.81% -0.01% -
Hits 17329 17330 +1 0
Misses 3102 3104 +2 0

Diff coverage report

Full coverage report

Optimization

cedfd0 #29143 783ba0
Total Total +/- New
Rate 88.73% 88.73% +0.00% -
Hits 2039 2040 +1 0
Misses 259 259 - 0

Diff coverage report

Full coverage report

Phase field

cedfd0 #29143 783ba0
Total Total +/- New
Rate 86.01% 86.00% -0.02% -
Hits 13693 13694 +1 0
Misses 2227 2230 +3 0

Diff coverage report

Full coverage report

Porous flow

cedfd0 #29143 783ba0
Total Total +/- New
Rate 95.30% 95.30% +0.00% -
Hits 11336 11337 +1 0
Misses 559 559 - 0

Diff coverage report

Full coverage report

Reactor

cedfd0 #29143 783ba0
Total Total +/- New
Rate 93.66% 93.64% -0.01% -
Hits 7617 7617 - 0
Misses 516 517 +1 0

Diff coverage report

Full coverage report

Solid mechanics

cedfd0 #29143 783ba0
Total Total +/- New
Rate 84.88% 84.88% +0.00% 100.00%
Hits 28284 28292 +8 3
Misses 5040 5040 - 0

Diff coverage report

Full coverage report

Solid properties

cedfd0 #29143 783ba0
Total Total +/- New
Rate 84.70% 84.51% -0.19% -
Hits 382 382 - 0
Misses 69 70 +1 0

Diff coverage report

Full coverage report

Thermal hydraulics

cedfd0 #29143 783ba0
Total Total +/- New
Rate 88.34% 88.34% -0.00% -
Hits 13913 13915 +2 0
Misses 1836 1837 +1 0

Diff coverage report

Full coverage report

Full coverage reports

Reports

This comment will be updated on new commits.

dschwen
dschwen previously approved these changes Nov 27, 2024
@loganharbour loganharbour force-pushed the data_better branch 2 times, most recently from f30f8e1 to 62b2473 Compare November 28, 2024 19:00
@loganharbour
Copy link
Member Author

@dschwen this is ready for review.

@loganharbour loganharbour merged commit 507f39e into idaholab:next Dec 2, 2024
63 checks passed
@loganharbour loganharbour deleted the data_better branch December 2, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Enable an application to retrieve its data path
3 participants