From 8e296e3a18b93b281144b45aae494268c27788da Mon Sep 17 00:00:00 2001 From: Arnaud Botella Date: Mon, 11 May 2026 08:48:43 +0200 Subject: [PATCH 1/4] fix(CSVInput): migrate to kebabCase --- src/geode/io/mesh/csv_input.cpp | 18 +++++++++--------- tests/data/missing_key_word.json | 12 ++++++------ tests/data/top_granitoid_vertices.json | 14 +++++++------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/geode/io/mesh/csv_input.cpp b/src/geode/io/mesh/csv_input.cpp index 857f273b..3c9369aa 100644 --- a/src/geode/io/mesh/csv_input.cpp +++ b/src/geode/io/mesh/csv_input.cpp @@ -71,12 +71,12 @@ namespace geode::CsvInputHelpers helpers{ filename_ }; nlohmann::json json; json_file_ >> json; - helpers.set_first_row( json["FirstRow"] ); - helpers.set_header_row( json["HeaderRow"] ); - helpers.set_separator( json["Separator"].get< std::string >()[0] ); - helpers.set_x_column( json["XColumn"] ); - helpers.set_y_column( json["YColumn"] ); - helpers.set_z_column( json["ZColumn"] ); + helpers.set_first_row( json["firstRow"] ); + helpers.set_header_row( json["headerRow"] ); + helpers.set_separator( json["separator"].get< std::string >()[0] ); + helpers.set_x_column( json["xColumn"] ); + helpers.set_y_column( json["yColumn"] ); + helpers.set_z_column( json["zColumn"] ); return helpers.create_point_set(); } @@ -92,9 +92,9 @@ namespace bool contains_all_info{ true }; nlohmann::json json; json_file_ >> json; - if( !json.contains( "FirstRow" ) || !json.contains( "HeaderRow" ) - || !json.contains( "Separator" ) || !json.contains( "XColumn" ) - || !json.contains( "YColumn" ) || !json.contains( "ZColumn" ) ) + if( !json.contains( "firstRow" ) || !json.contains( "headerRow" ) + || !json.contains( "separator" ) || !json.contains( "xColumn" ) + || !json.contains( "yColumn" ) || !json.contains( "zColumn" ) ) { contains_all_info = false; } diff --git a/tests/data/missing_key_word.json b/tests/data/missing_key_word.json index b76ed0e8..0d970e8b 100644 --- a/tests/data/missing_key_word.json +++ b/tests/data/missing_key_word.json @@ -1,7 +1,7 @@ { - "FirstRow": 1, - "HeaderRow": 0, - "XColumn": 1, - "YColumn": 2, - "ZColumn": 3 -} \ No newline at end of file + "firstRow": 1, + "headerRow": 0, + "xColumn": 1, + "yColumn": 2, + "zColumn": 3 +} diff --git a/tests/data/top_granitoid_vertices.json b/tests/data/top_granitoid_vertices.json index ff4c3a54..71d28d86 100644 --- a/tests/data/top_granitoid_vertices.json +++ b/tests/data/top_granitoid_vertices.json @@ -1,8 +1,8 @@ { - "FirstRow": 1, - "HeaderRow": 0, - "Separator": ",", - "XColumn": 0, - "YColumn": 1, - "ZColumn": 2 -} \ No newline at end of file + "firstRow": 1, + "headerRow": 0, + "separator": ",", + "xColumn": 0, + "yColumn": 1, + "zColumn": 2 +} From d7c53ddc25fc2b28ad71de93629d74e497686fb2 Mon Sep 17 00:00:00 2001 From: Arnaud Botella Date: Mon, 11 May 2026 09:01:27 +0200 Subject: [PATCH 2/4] tidy --- .vscode/settings.json | 70 ++++++++++---------- include/geode/io/mesh/internal/csv_input.hpp | 49 +++++++------- src/geode/io/mesh/csv_input.cpp | 33 ++++----- 3 files changed, 73 insertions(+), 79 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 78136e6a..dae6cba4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,35 +1,37 @@ { - "C_Cpp.default.cppStandard": "c++17", - "C_Cpp.default.includePath": [ - "${workspaceFolder}/include", - "${workspaceFolder}/build/opengeode-io/include", - "${workspaceFolder}/build/third_party/assimp/install/include", - "${workspaceFolder}/build/third_party/pugixml/install/include", - "${workspaceFolder}/build/third_party/zlib/install/include", - "${workspaceFolder:OpenGeode}/include", - "${workspaceFolder:OpenGeode}/build/opengeode/include", - "${workspaceFolder:OpenGeode}/build/third_party/abseil/install/include", - "${workspaceFolder:OpenGeode}/build/third_party/bitsery/install/include", - "${workspaceFolder:OpenGeode}/build/third_party/gdal/install/include", - "${workspaceFolder:OpenGeode}/build/third_party/pybind11/install/include", - "${workspaceFolder:OpenGeode}/build/third_party/asyncplusplus/install/include" - ], - "C_Cpp.default.browse.path": [ - "${workspaceFolder}/include", - "${workspaceFolder}/src", - "${workspaceFolder}/build/opengeode-io/include", - "${workspaceFolder}/build/third_party/assimp/install/include", - "${workspaceFolder}/build/third_party/pugixml/install/include", - "${workspaceFolder}/build/third_party/zlib/install/include", - "${workspaceFolder:OpenGeode}/include", - "${workspaceFolder:OpenGeode}/build/opengeode/include", - "${workspaceFolder:OpenGeode}/build/third_party/abseil/install/include", - "${workspaceFolder:OpenGeode}/build/third_party/bitsery/install/include", - "${workspaceFolder:OpenGeode}/build/third_party/gdal/install/include", - "${workspaceFolder:OpenGeode}/build/third_party/pybind11/install/include", - "${workspaceFolder:OpenGeode}/build/third_party/asyncplusplus/install/include" - ], - "files.watcherExclude": { - "${workspaceFolder}/build/**": true - } -} \ No newline at end of file + "C_Cpp.default.cppStandard": "c++17", + "C_Cpp.default.includePath": [ + "${workspaceFolder}/include", + "${workspaceFolder}/build/opengeode-io/include", + "${workspaceFolder}/build/third_party/assimp/install/include", + "${workspaceFolder}/build/third_party/pugixml/install/include", + "${workspaceFolder}/build/third_party/json/install/include", + "${workspaceFolder}/build/third_party/zlib/install/include", + "${workspaceFolder:OpenGeode}/include", + "${workspaceFolder:OpenGeode}/build/opengeode/include", + "${workspaceFolder:OpenGeode}/build/third_party/abseil/install/include", + "${workspaceFolder:OpenGeode}/build/third_party/bitsery/install/include", + "${workspaceFolder:OpenGeode}/build/third_party/gdal/install/include", + "${workspaceFolder:OpenGeode}/build/third_party/pybind11/install/include", + "${workspaceFolder:OpenGeode}/build/third_party/asyncplusplus/install/include" + ], + "C_Cpp.default.browse.path": [ + "${workspaceFolder}/include", + "${workspaceFolder}/src", + "${workspaceFolder}/build/opengeode-io/include", + "${workspaceFolder}/build/third_party/assimp/install/include", + "${workspaceFolder}/build/third_party/pugixml/install/include", + "${workspaceFolder}/build/third_party/json/install/include", + "${workspaceFolder}/build/third_party/zlib/install/include", + "${workspaceFolder:OpenGeode}/include", + "${workspaceFolder:OpenGeode}/build/opengeode/include", + "${workspaceFolder:OpenGeode}/build/third_party/abseil/install/include", + "${workspaceFolder:OpenGeode}/build/third_party/bitsery/install/include", + "${workspaceFolder:OpenGeode}/build/third_party/gdal/install/include", + "${workspaceFolder:OpenGeode}/build/third_party/pybind11/install/include", + "${workspaceFolder:OpenGeode}/build/third_party/asyncplusplus/install/include" + ], + "files.watcherExclude": { + "${workspaceFolder}/build/**": true + } +} diff --git a/include/geode/io/mesh/internal/csv_input.hpp b/include/geode/io/mesh/internal/csv_input.hpp index 3d3c1eab..4ee20bf3 100644 --- a/include/geode/io/mesh/internal/csv_input.hpp +++ b/include/geode/io/mesh/internal/csv_input.hpp @@ -31,37 +31,34 @@ namespace geode ALIAS_3D( PointSet ); } // namespace geode -namespace geode +namespace geode::internal { - namespace internal + class CSVInput final : public PointSetInput< 3 > { - class CSVInput final : public PointSetInput< 3 > + public: + explicit CSVInput( std::string_view filename ) + : PointSetInput< 3 >( filename ) { - public: - explicit CSVInput( std::string_view filename ) - : PointSetInput< 3 >( filename ) - { - } + } - static std::string_view extension() - { - static constexpr auto EXT = "csv"; - return EXT; - } + static std::string_view extension() + { + static constexpr auto EXT = "csv"; + return EXT; + } - std::unique_ptr< PointSet3D > read( const MeshImpl& impl ) final; + std::unique_ptr< PointSet3D > read( const MeshImpl& impl ) final; - AdditionalFiles additional_files() const final; + AdditionalFiles additional_files() const final; - index_t object_priority() const final - { - return 0; - } + index_t object_priority() const final + { + return 0; + } - Percentage is_loadable() const final - { - return Percentage{ 1 }; - } - }; - } // namespace internal -} // namespace geode \ No newline at end of file + Percentage is_loadable() const final + { + return Percentage{ 1 }; + } + }; +} // namespace geode::internal \ No newline at end of file diff --git a/src/geode/io/mesh/csv_input.cpp b/src/geode/io/mesh/csv_input.cpp index 3c9369aa..85c1086e 100644 --- a/src/geode/io/mesh/csv_input.cpp +++ b/src/geode/io/mesh/csv_input.cpp @@ -21,7 +21,7 @@ * */ -#pragma once +#include #include #include @@ -47,7 +47,6 @@ #include #include -#include #include #include @@ -57,7 +56,7 @@ namespace class CSVInputImpl { public: - CSVInputImpl( std::string_view filename ) + explicit CSVInputImpl( std::string_view filename ) : filename_{ filename }, json_filename_{ geode::to_string( filename.substr( 0, filename.find_last_of( '.' ) ) ) @@ -110,22 +109,18 @@ namespace }; } // namespace -namespace geode +namespace geod::internal { - namespace internal + std::unique_ptr< PointSet3D > CSVInput::read( const MeshImpl& impl ) { - std::unique_ptr< PointSet3D > CSVInput::read( const MeshImpl& impl ) - { - geode_unused( impl ); - CSVInputImpl reader{ this->filename() }; - return reader.point_set(); - } + geode_unused( impl ); + CSVInputImpl reader{ this->filename() }; + return reader.point_set(); + } - AdditionalFiles CSVInput::additional_files() const - { - CSVInputImpl reader{ this->filename() }; - return reader.additional_files(); - } - - } // namespace internal -} // namespace geode \ No newline at end of file + AdditionalFiles CSVInput::additional_files() const + { + CSVInputImpl reader{ this->filename() }; + return reader.additional_files(); + } +} // namespace geod::internal \ No newline at end of file From b3567f89b91c9e33f92337bf36a6ede83cd2fb3a Mon Sep 17 00:00:00 2001 From: Arnaud Botella Date: Mon, 11 May 2026 09:05:42 +0200 Subject: [PATCH 3/4] fix --- src/geode/io/mesh/csv_input.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/geode/io/mesh/csv_input.cpp b/src/geode/io/mesh/csv_input.cpp index 85c1086e..5065e538 100644 --- a/src/geode/io/mesh/csv_input.cpp +++ b/src/geode/io/mesh/csv_input.cpp @@ -109,18 +109,22 @@ namespace }; } // namespace -namespace geod::internal +namespace geode { - std::unique_ptr< PointSet3D > CSVInput::read( const MeshImpl& impl ) + namespace internal { - geode_unused( impl ); - CSVInputImpl reader{ this->filename() }; - return reader.point_set(); - } + std::unique_ptr< PointSet3D > CSVInput::read( const MeshImpl& impl ) + { + geode_unused( impl ); + CSVInputImpl reader{ this->filename() }; + return reader.point_set(); + } - AdditionalFiles CSVInput::additional_files() const - { - CSVInputImpl reader{ this->filename() }; - return reader.additional_files(); - } -} // namespace geod::internal \ No newline at end of file + AdditionalFiles CSVInput::additional_files() const + { + CSVInputImpl reader{ this->filename() }; + return reader.additional_files(); + } + + } // namespace internal +} // namespace geode \ No newline at end of file From 1ac5a8d9382392c031662fb0c7ce8bf3ba22e3fb Mon Sep 17 00:00:00 2001 From: Arnaud Botella Date: Mon, 11 May 2026 09:07:35 +0200 Subject: [PATCH 4/4] tidy2 --- include/geode/io/mesh/internal/csv_input.hpp | 9 +++++---- src/geode/io/mesh/csv_input.cpp | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/geode/io/mesh/internal/csv_input.hpp b/include/geode/io/mesh/internal/csv_input.hpp index 4ee20bf3..d6a8e560 100644 --- a/include/geode/io/mesh/internal/csv_input.hpp +++ b/include/geode/io/mesh/internal/csv_input.hpp @@ -47,16 +47,17 @@ namespace geode::internal return EXT; } - std::unique_ptr< PointSet3D > read( const MeshImpl& impl ) final; + [[nodiscard]] std::unique_ptr< PointSet3D > read( + const MeshImpl& impl ) final; - AdditionalFiles additional_files() const final; + [[nodiscard]] AdditionalFiles additional_files() const final; - index_t object_priority() const final + [[nodiscard]] index_t object_priority() const final { return 0; } - Percentage is_loadable() const final + [[nodiscard]] Percentage is_loadable() const final { return Percentage{ 1 }; } diff --git a/src/geode/io/mesh/csv_input.cpp b/src/geode/io/mesh/csv_input.cpp index 5065e538..58baed92 100644 --- a/src/geode/io/mesh/csv_input.cpp +++ b/src/geode/io/mesh/csv_input.cpp @@ -116,13 +116,13 @@ namespace geode std::unique_ptr< PointSet3D > CSVInput::read( const MeshImpl& impl ) { geode_unused( impl ); - CSVInputImpl reader{ this->filename() }; + CSVInputImpl reader{ filename() }; return reader.point_set(); } AdditionalFiles CSVInput::additional_files() const { - CSVInputImpl reader{ this->filename() }; + CSVInputImpl reader{ filename() }; return reader.additional_files(); }