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

[c++] Column abstraction: SOMADimension, part 1 #3425

Merged
merged 22 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4778cb4
Add helper methods for to and from arrow contructs
XanthosXanthopoulos Nov 21, 2024
2c9955a
SOMAColumn abstract class definition
XanthosXanthopoulos Nov 18, 2024
6d0b9f9
Remove fmt::format
XanthosXanthopoulos Nov 20, 2024
911d005
Remove unneeded methods and member variables
XanthosXanthopoulos Nov 21, 2024
5c997d5
Add concrete class wrapper for TileDB dimension
XanthosXanthopoulos Nov 21, 2024
7fb9329
Add minimal testing for dimensions
XanthosXanthopoulos Nov 21, 2024
a5b81d5
Misc fixes
XanthosXanthopoulos Nov 21, 2024
dca737c
Add read test case
XanthosXanthopoulos Nov 22, 2024
883fc85
Add missing `override`
XanthosXanthopoulos Nov 22, 2024
3dd3c90
Remove current_domain flag
XanthosXanthopoulos Nov 24, 2024
904d799
Add virtual destructor [skip ci]
XanthosXanthopoulos Nov 25, 2024
902b073
Bump min macos version (Remove commit after merging 3361)
XanthosXanthopoulos Nov 26, 2024
0a7d54e
Replace string_view with string when returning column name, add curre…
XanthosXanthopoulos Dec 6, 2024
698e36e
Fix unit test
XanthosXanthopoulos Dec 11, 2024
9b6a2d5
Add better description to SOMACOlumn
XanthosXanthopoulos Dec 11, 2024
61a5b05
Add description and license
XanthosXanthopoulos Dec 13, 2024
0ad22da
Address review comments
XanthosXanthopoulos Dec 31, 2024
ead3bde
Fix unit tests
XanthosXanthopoulos Dec 31, 2024
8fb7390
Remove duplicate declaration
XanthosXanthopoulos Dec 31, 2024
f920bfe
Comply with C.128
XanthosXanthopoulos Jan 2, 2025
a7da4fa
lint fixes
XanthosXanthopoulos Jan 2, 2025
5e0db11
Add missing comment
XanthosXanthopoulos Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apis/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def run(self):
CXX_FLAGS.append(f'-Wl,-rpath,{str(tiledb_dir / "lib")}')

if sys.platform == "darwin":
CXX_FLAGS.append("-mmacosx-version-min=11.0")
CXX_FLAGS.append("-mmacosx-version-min=13.3")

if os.name == "posix" and sys.platform != "darwin":
LIB_DIRS.append(str(tiledbsoma_dir / "lib" / "x86_64-linux-gnu"))
Expand Down
4 changes: 4 additions & 0 deletions libtiledbsoma/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ add_library(TILEDB_SOMA_OBJECTS OBJECT
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_array.cc
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_group.cc
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_object.cc
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_column.cc
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_dimension.cc
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_collection.cc
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_experiment.cc
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_measurement.cc
Expand Down Expand Up @@ -206,6 +208,8 @@ install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/soma/column_buffer.h
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_array.h
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_group.h
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_column.h
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_dimension.h
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_collection.h
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_dataframe.h
${CMAKE_CURRENT_SOURCE_DIR}/soma/soma_dense_ndarray.h
Expand Down
14 changes: 14 additions & 0 deletions libtiledbsoma/src/soma/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,18 @@ enum class ResultOrder { automatic = 0, rowmajor, colmajor };
/** Defines whether the SOMAGroup URI is absolute or relative */
enum class URIType { automatic = 0, absolute, relative };

typedef enum {
SOMA_COLUMN_DIMENSION = 0,
SOMA_COLUMN_ATTRIBUTE = 1,
SOMA_COLUMN_GEOMETRY = 2
} soma_column_datatype_t;

// This enables some code deduplication between core domain, core current
// domain, and core non-empty domain.
enum class Domainish {
kind_core_domain = 0,
kind_core_current_domain = 1,
kind_non_empty_domain = 2
};

#endif // SOMA_ENUMS
8 changes: 0 additions & 8 deletions libtiledbsoma/src/soma/soma_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,6 @@ using namespace tiledb;

using StatusAndReason = std::pair<bool, std::string>;

// This enables some code deduplication between core domain, core current
// domain, and core non-empty domain.
enum class Domainish {
kind_core_domain = 0,
kind_core_current_domain = 1,
kind_non_empty_domain = 2
};

class SOMAArray : public SOMAObject {
public:
friend class ManagedQuery;
Expand Down
62 changes: 62 additions & 0 deletions libtiledbsoma/src/soma/soma_column.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* @file soma_column.cc
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2024 TileDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @section DESCRIPTION
*
* This file defines the SOMAColumn class.
*/

#include "soma_column.h"

namespace tiledbsoma {

template <>
std::pair<std::string, std::string> SOMAColumn::core_domain_slot<std::string>()
const {
return std::pair<std::string, std::string>("", "");
}

template <>
std::pair<std::string, std::string>
SOMAColumn::core_current_domain_slot<std::string>(
const SOMAContext& ctx, Array& array) const {
try {
std::pair<std::string, std::string>
current_domain = std::any_cast<std::pair<std::string, std::string>>(
_core_current_domain_slot(ctx, array));

if (current_domain.first == "" && (current_domain.second == "\x7f" ||
jp-dark marked this conversation as resolved.
Show resolved Hide resolved
current_domain.second == "\xff")) {
return std::pair<std::string, std::string>("", "");
}

return current_domain;
} catch (const std::exception& e) {
throw TileDBSOMAError(e.what());
}
}
} // namespace tiledbsoma
Loading