Skip to content

Commit

Permalink
fix: remove pretty type
Browse files Browse the repository at this point in the history
  • Loading branch information
skim0119 committed Jul 20, 2024
1 parent 8da7f85 commit a984130
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions backend/src/Systems/CosseratRods/Python/BindCosseratRod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Systems/Block/Block.hpp" // slice()
#include "Systems/CosseratRods/CosseratRods.hpp"
//
#include "Systems/CosseratRods/Python/Generators/BindEnergyMethods.hpp"
// #include "Systems/CosseratRods/Python/Generators/BindEnergyMethods.hpp"
#include "Systems/CosseratRods/Python/Generators/BindMemberAccess.hpp"
#include "Systems/CosseratRods/Python/Generators/BoundChecks.hpp"
#include "Systems/CosseratRods/Python/Generators/BindPyElasticaInterface.hpp"
Expand Down Expand Up @@ -51,7 +51,7 @@ namespace py_bindings {
bind_member_access<UnwantedVariableTags>(py_cosserat_rod);
bind_variable_locator<UnwantedVariableTags>(py_cosserat_rod);
bind_pyelastica_interface<UnwantedVariableTags>(py_cosserat_rod);
bind_energy_methods(py_cosserat_rod);
// bind_energy_methods(py_cosserat_rod);
}
{
using type = ::elastica::cosserat_rod::detail::CosseratRodBlockView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "Systems/Block/TypeTraits.hpp"
#include "Systems/CosseratRods/BlockSlice.hpp"
#include "Systems/CosseratRods/CosseratRodPlugin.hpp"
#include "Systems/common/Traits/DataType/Rank.hpp"
#include "Systems/CosseratRods/Traits/DataType/Rank.hpp"
#include "Systems/CosseratRods/Traits/PlacementTraits/PlacementTraits.hpp"
//
#include "Systems/CosseratRods/Python/Generators/BoundChecks.hpp"
Expand All @@ -17,7 +17,7 @@
#include "Utilities/IgnoreUnused.hpp"
#include "Utilities/MakeString.hpp"
#include "Utilities/Overloader.hpp"
#include "Utilities/PrettyType.hpp"
// #include "Utilities/PrettyType.hpp"
#include "Utilities/TMPL.hpp"
//
#include <pybind11/pybind11.h>
Expand Down Expand Up @@ -66,9 +66,9 @@ namespace py_bindings {
// Rank in case of a CosseratRod is Vector, Matrix, or Tensor, each of
// which has a rank type-def, which we query

std::string variable_name = pretty_type::short_name<Variable>();
std::string variable_name = typeid(v).name(); // pretty_type::short_name<Variable>();
// cam use
std::string tag_name = pretty_type::get_name<VariableTag>();
std::string tag_name = ""; // FIXME: pretty_type::get_name<VariableTag>();
std::string method_prefix = "get_";
std::string method_name =
method_prefix +
Expand All @@ -93,8 +93,8 @@ namespace py_bindings {
// clang-format on
<< "array containing data of "
// TODO: Refactor : this relies on blaze interface
<< pretty_type::short_name<
typename VariableRank::type::ElementType>()
// << pretty_type::short_name<
// typename VariableRank::type::ElementType>()
<< " type. See documentation of " << tag_name
<< " for more details.");

Expand All @@ -119,8 +119,8 @@ namespace py_bindings {
// clang-format on
<< "slice containing data of "
// TODO: Refactor : this relies on blaze interface
<< pretty_type::short_name<
typename VariableRank::type::ElementType>()
// << pretty_type::short_name<
// typename VariableRank::type::ElementType>()
<< " type. See documentation of " << tag_name
<< " for more details.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
#include "Utilities/ConvertCase/ConvertCase.hpp"
#include "Utilities/Overloader.hpp"
#include "Utilities/PrettyType.hpp"
// #include "Utilities/PrettyType.hpp"
//
#include <pybind11/pybind11.h>
//
Expand Down Expand Up @@ -74,7 +74,7 @@ namespace py_bindings {
// fallback for other tags that are not defined in PyElastica
[](auto tag) -> std::string {
namespace cc = convert_case;
return cc::convert(pretty_type::short_name<decltype(tag)>(),
return cc::convert(typeid(tag).name(), //pretty_type::short_name<decltype(tag)>(),
cc::FromPascalCase{}, cc::ToSnakeCase{});
});
#undef MAP
Expand All @@ -84,7 +84,7 @@ namespace py_bindings {
using Variable = tmpl::type_from<decltype(v)>;
using VariableTag = ::blocks::parameter_t<Variable>;
std::string help_str =
"Refer to documentation of " + pretty_type::get_name<VariableTag>();
"Refer to documentation of " + typeid(v).name();
context.def_property(
tag_to_method_map(VariableTag{}).c_str(),
+[](type& self) { return ::blocks::get<VariableTag>(self); },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "Utilities/IgnoreUnused.hpp"
#include "Utilities/MakeString.hpp"
#include "Utilities/Overloader.hpp"
#include "Utilities/PrettyType.hpp"
// #include "Utilities/PrettyType.hpp"
#include "Utilities/TMPL.hpp"
//
#include <pybind11/pybind11.h>
Expand Down Expand Up @@ -59,9 +59,9 @@ namespace py_bindings {
// Rank in case of a CosseratRod is Vector, Matrix, or Tensor, each of
// which has a rank type-def, which we query

std::string variable_name = pretty_type::short_name<Variable>();
std::string variable_name = typeid(v).name(); //pretty_type::short_name<Variable>();
// cam use
std::string tag_name = pretty_type::get_name<VariableTag>();
std::string tag_name = ""; // FIXME: pretty_type::get_name<VariableTag>();
std::string method_prefix = "get_";
std::string method_name =
method_prefix +
Expand All @@ -82,8 +82,8 @@ namespace py_bindings {
// clang-format off
<< " (" << dim_doc_generator(typename VariableRank::rank{}) << ") "
// clang-format on
<< "array containing data of "
<< pretty_type::short_name<::elastica::real_t>()
<< "array containing data of real_t"
// << pretty_type::short_name<::elastica::real_t>()
<< " type. See documentation of " << tag_name
<< " for more details.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "Systems/common/Python/Generators/VariableFilter.hpp"
#include "Systems/common/Python/Generators/VariableLocator.hpp"
//
#include "Utilities/PrettyType.hpp"
// #include "Utilities/PrettyType.hpp"
//
#include <pybind11/pybind11.h>
//
Expand Down Expand Up @@ -41,7 +41,7 @@ namespace py_bindings {
// the tags are registered globally in the systems.tags module
auto register_property = [](auto& bound_class_, auto tag) {
using VariableTag = decltype(tag);
std::string tag_name = pretty_type::short_name<VariableTag>();
std::string tag_name = typeid(tag).name(); // pretty_type::short_name<VariableTag>();
bound_class_.def_property_readonly_static(
tag_name.c_str(),
[](py::object /* self */) { return VariableTag{}; });
Expand Down

0 comments on commit a984130

Please sign in to comment.