Skip to content

Commit

Permalink
hotfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloprobst committed Oct 16, 2024
1 parent 3e09314 commit 61b27f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
7 changes: 3 additions & 4 deletions hyperon_das_atomdb_cpp/src/document_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ class Node : public Atom {
* @param named_type The named type of the Node.
* @param name The name of the Node.
* @param custom_attributes Optional custom attributes for the Node. Defaults to an empty map.
* @throws invalid_argument if the name is empty.
*/
Node(const string& id,
const string& handle,
Expand Down Expand Up @@ -297,7 +296,7 @@ class Link : public Atom {
/**
* @brief Constructs a Link with a type, targets documents, and optional custom attributes.
* @param type The type of the Link.
* @param targets_documents The targets documents associated with the Link.
* @param targets The targets documents associated with the Link.
* @param custom_attributes Optional custom attributes for the Link. Defaults to an empty map.
* @note This constructor is intended to be used only when passing in the basic building
* parameters to other functions. For creating complete new Link objects, use the
Expand Down Expand Up @@ -346,9 +345,9 @@ class Link : public Atom {
* ```
*/
Link(const string& type,
const TargetsDocuments& targets_documents,
const TargetsDocuments& targets,
const CustomAttributes& custom_attributes = CustomAttributes{})
: targets_documents(targets_documents), Atom(type, custom_attributes) {}
: targets_documents(targets), Atom(type, custom_attributes) {}

/**
* @brief Constructs a Link object with the specified parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ NB_MODULE(ext, m) {
nb::module_ document_types = m.def_submodule("document_types");
nb::class_<Atom>(document_types, "Atom")
.def_ro("_id", &Atom::_id)
.def_prop_ro("id", // RO property for having access to `_id` as `id`
.def_prop_ro("id", // read-only property for having access to `_id` as `id`
[](const Atom& self) -> string { return self._id; })
.def_ro("handle", &Atom::handle)
.def_ro("composite_type_hash", &Atom::composite_type_hash)
Expand Down Expand Up @@ -313,10 +313,10 @@ NB_MODULE(ext, m) {
* constructor with all parameters.
*/
nb::init<const string&, // type
const Link::TargetsDocuments&, // targets_documents
const Link::TargetsDocuments&, // targets
const CustomAttributes&>(), // custom_attributes
"type"_a,
"targets_documents"_a,
"targets"_a,
"custom_attributes"_a = CustomAttributes{})
.def("__init__",
&helpers::init_link,
Expand Down
22 changes: 0 additions & 22 deletions hyperon_das_atomdb_cpp/src/utils/expression_hasher.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,6 @@ class ExpressionHasher {
return move(compute_hash(hashable_string));
}

// /**
// * @brief Generates a composite hash from a list of elements.
// *
// * This function takes a vector of elements, each of which can be of any type,
// * and generates a composite hash representing the combined hash of all elements.
// *
// * @param elements A vector of elements of type std::any, representing the components to be
// * hashed.
// * @return A string representing the composite hash generated from the elements.
// */
// static std::string composite_hash(const ListOfAny& elements) {
// StringList hashable_elements;
// for (const auto& element : elements) {
// if (auto str = any_cast<string>(&element)) {
// hashable_elements.emplace_back(*str);
// } else {
// throw invalid_argument("Invalid composite type element.");
// }
// }
// return move(composite_hash(hashable_elements));
// }

/**
* @brief Generates a composite hash from a base hash.
*
Expand Down

0 comments on commit 61b27f8

Please sign in to comment.