Skip to content

Commit f549b73

Browse files
committed
fix python
1 parent 3f59771 commit f549b73

4 files changed

Lines changed: 44 additions & 22 deletions

File tree

bindings/python/src/basic/attribute_manager.cpp

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,49 @@ namespace geode
3636
void python_attribute_class( pybind11::class_< AttributeManager >& manager,
3737
const std::string& suffix )
3838
{
39-
const auto read_suffix = absl::StrCat( "find_attribute_", suffix );
39+
const auto read_suffix = absl::StrCat( "read_attribute_", suffix );
4040
manager.def(
41-
read_suffix.c_str(), &AttributeManager::find_attribute< type > );
42-
const auto constant_suffix =
43-
absl::StrCat( "find_or_create_attribute_constant_", suffix );
44-
manager.def( constant_suffix.c_str(),
41+
read_suffix.c_str(), &AttributeManager::read_attribute< type > );
42+
const auto create_constant_suffix =
43+
absl::StrCat( "create_attribute_constant_", suffix );
44+
manager.def( create_constant_suffix.c_str(),
45+
static_cast< geode::uuid ( AttributeManager::* )(
46+
std::string_view, type ) >(
47+
&AttributeManager::create_attribute< ConstantAttribute,
48+
type > ) );
49+
const auto find_constant_suffix =
50+
absl::StrCat( "find_attribute_constant_", suffix );
51+
manager.def( find_constant_suffix.c_str(),
4552
static_cast< std::shared_ptr< ConstantAttribute< type > > (
46-
AttributeManager::* )( std::string_view, type ) >(
47-
&AttributeManager::find_or_create_attribute< ConstantAttribute,
53+
AttributeManager::* )( const geode::uuid& ) >(
54+
&AttributeManager::find_attribute< ConstantAttribute,
55+
type > ) );
56+
const auto create_variable_suffix =
57+
absl::StrCat( "create_attribute_variable_", suffix );
58+
manager.def( create_variable_suffix.c_str(),
59+
static_cast< geode::uuid ( AttributeManager::* )(
60+
std::string_view, type ) >(
61+
&AttributeManager::create_attribute< VariableAttribute,
4862
type > ) );
49-
const auto variable_suffix =
50-
absl::StrCat( "find_or_create_attribute_variable_", suffix );
51-
manager.def( variable_suffix.c_str(),
63+
const auto find_variable_suffix =
64+
absl::StrCat( "find_attribute_variable_", suffix );
65+
manager.def( find_variable_suffix.c_str(),
5266
static_cast< std::shared_ptr< VariableAttribute< type > > (
53-
AttributeManager::* )( std::string_view, type ) >(
54-
&AttributeManager::find_or_create_attribute< VariableAttribute,
67+
AttributeManager::* )( const geode::uuid& ) >(
68+
&AttributeManager::find_attribute< VariableAttribute,
5569
type > ) );
56-
const auto sparse_suffix =
57-
absl::StrCat( "find_or_create_attribute_sparse_", suffix );
58-
manager.def( sparse_suffix.c_str(),
70+
const auto create_sparse_suffix =
71+
absl::StrCat( "create_attribute_sparse_", suffix );
72+
manager.def( create_sparse_suffix.c_str(),
73+
static_cast< geode::uuid ( AttributeManager::* )( std::string_view,
74+
type ) >( &AttributeManager::create_attribute< SparseAttribute,
75+
type > ) );
76+
const auto find_sparse_suffix =
77+
absl::StrCat( "find_attribute_sparse_", suffix );
78+
manager.def( find_sparse_suffix.c_str(),
5979
static_cast< std::shared_ptr< SparseAttribute< type > > (
60-
AttributeManager::* )( std::string_view, type ) >(
61-
&AttributeManager::find_or_create_attribute< SparseAttribute,
62-
type > ) );
80+
AttributeManager::* )( const geode::uuid& ) >(
81+
&AttributeManager::find_attribute< SparseAttribute, type > ) );
6382
}
6483

6584
void define_attribute_manager( pybind11::module& module )
@@ -69,7 +88,7 @@ namespace geode
6988
manager.def( pybind11::init<>() )
7089
.def( "find_generic_attribute",
7190
&AttributeManager::find_generic_attribute )
72-
.def( "attribute_names", &AttributeManager::attribute_names )
91+
.def( "attribute_ids", &AttributeManager::attribute_ids )
7392
.def( "attribute_type", &AttributeManager::attribute_type )
7493
.def( "attribute_exists", &AttributeManager::attribute_exists )
7594
.def( "nb_elements", &AttributeManager::nb_elements )

include/geode/model/representation/io/geode/geode_brep_input.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace geode
7171
{
7272
BRepBuilder builder{ brep };
7373
const auto level = Logger::level();
74-
Logger::set_level( Logger::LEVEL::warn );
74+
// Logger::set_level( Logger::LEVEL::warn );
7575
async::parallel_invoke(
7676
[&builder, &directory] {
7777
builder.load_identifier( directory );

src/geode/basic/attribute_manager.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,11 @@ namespace geode
233233
std::vector< uuid > ids;
234234
for( const auto &[attribute_id, attribute] : attributes_ )
235235
{
236-
if( attribute->name() == name )
236+
if( !attribute->name().has_value() )
237+
{
238+
continue;
239+
}
240+
if( attribute->name().value() == name )
237241
{
238242
ids.push_back( attribute_id );
239243
}

tests/mesh/test-merge-surface.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ void test_import()
142142
}
143143
geode::NNSearch3D nns( points );
144144
const auto mappings = nns.colocated_index_mapping( geode::GLOBAL_EPSILON );
145-
DEBUG( mappings.nb_colocated_points() );
146145
geode::OpenGeodeMeshException::test( mappings.nb_colocated_points() == 0,
147146
"Should be no more colocated points" );
148147
for( const auto p : geode::Indices{ points } )

0 commit comments

Comments
 (0)