-
Notifications
You must be signed in to change notification settings - Fork 90
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
refactor: Refactoring dump input option #3566
base: develop
Are you sure you want to change the base?
Conversation
@@ -241,6 +241,68 @@ void TableTextFormatter::setLinks( std::vector< TableLayout::Column > & columns | |||
} | |||
} | |||
|
|||
std::string_view ltrim( std::string_view s ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be constexpr.
return {}; | ||
} | ||
|
||
bool formatLinesWithMaxSize( std::vector< std::string > & cellLines, size_t maxLength ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those two functions can be helpful! You could generalize a bit (erase table/cell namings) and add them to StringUtilities.xpp
:)
Also, this function produces incorrect results for { "Les shorts c'est pratique, ça laisse les jambes bien au frais.", 8}
(obviously, also for maxLength=6
).
// Contain the max width for each column | ||
size_t m_tableColumnMaxWidth = std::numeric_limits< size_t >::max(); | ||
// Indicate if a max column width has been set | ||
bool m_hasMaxColumnWidthSet = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could only keep one attribute here:
using NoColumnMaxWidth = std::numeric_limits< size_t >::max();
size_t m_tableColumnMaxWidth = NoColumnMaxWidth;
And in isMaxColumnWidthSet()
: return m_tableColumnMaxWidth == NoColumnMaxWidth;
@@ -302,13 +305,29 @@ string Group::dumpInputOptions() const | |||
{ | |||
string rval; | |||
|
|||
bool writeHeader = true; | |||
TableLayout logLayout( "", {TableLayout::Column() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TableLayout logLayout( "", {TableLayout::Column() | |
TableLayout const logLayout( "", {TableLayout::Column() |
@@ -727,11 +727,11 @@ class Wrapper final : public WrapperBase | |||
targetNode, | |||
inputFlag == InputFlags::REQUIRED ); | |||
GEOS_THROW_IF( !m_successfulReadFromInput, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show a comprehensive output of the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
***** Input value: ''
***** LOCATION: /data/pau901/VDG_GSI/ARNAUDD/geosRepos/codes/GEOS4/src/coreComponents/dataRepository/Wrapper.hpp:729
***** Controlling expression (should be false): !m_successfulReadFromInput
***** Rank 3: XML Node CompositionalMultiphaseFVM (2ph_cap_1d_ihu.xml, l.5) with name=compflow is missing required attribute 'discretization'.
For more details, please refer to documentation at:
http://geosx-geosx.readthedocs-hosted.com/en/latest/docs/sphinx/userGuide/Index.html
This PR aim to refactor, with the tableFormatter, the dumping output fonction.
When we have unused input option to an XML element node, we get this kind of input :
With the table, we get instead :