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

Export property types #65

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
33 changes: 31 additions & 2 deletions src/python/export_ghostfragment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,40 @@
* limitations under the License.
*/

#include "ghostfragment/property_types/fragmenting/capped_fragments.hpp"
#include "ghostfragment/property_types/fragmenting/fragment_weights.hpp"
#include "ghostfragment/property_types/fragmenting/fragmented_chemical_system.hpp"
#include "ghostfragment/property_types/fragmenting/fragmented_nuclei.hpp"
#include "ghostfragment/property_types/fragmenting/intersections.hpp"
#include "ghostfragment/property_types/fragmenting/nuclear_graph_to_fragments.hpp"
#include "ghostfragment/property_types/topology/broken_bonds.hpp"
#include "ghostfragment/property_types/topology/connectivity_table.hpp"
#include "ghostfragment/property_types/topology/nuclear_graph.hpp"
#include "property_type/macros.hpp"
#include <ghostfragment/ghostfragment.hpp>
#include <pluginplay/pluginplay.hpp>

namespace ghostfragment {
namespace ghostfragment::pt {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the namespace the ghostfragment python module is extracted into. We want it to be extracted into the ghostfragment namespace, not ghostfragment::pt.

Suggested change
namespace ghostfragment::pt {
namespace ghostfragment {


EXPORT_PLUGIN(ghostfragment, m) {}
EXPORT_PLUGIN(ghostfragment, m) {
EXPORT_PROPERTY_TYPE(CappedFragments, m);
// EXPORT_PROPERTY_TYPE(pt::CappedFragmentsTraits, m);
EXPORT_PROPERTY_TYPE(NuclearGraphToFragments, m);
// EXPORT_PROPERTY_TYPE(pt::NuclearGraphToFragmentsTraits, m);
EXPORT_PROPERTY_TYPE(NuclearGraph, m);
// EXPORT_PROPERTY_TYPE(pt::NuclearGraphTraits, m);
EXPORT_PROPERTY_TYPE(FragmentedNuclei, m);
// EXPORT_PROPERTY_TYPE(pt::FragmentedNucleiTraits, m);
EXPORT_PROPERTY_TYPE(FragmentedChemicalSystem, m);
// EXPORT_PROPERTY_TYPE(pt::FragmentedChemicalSystemTraits, m);
EXPORT_PROPERTY_TYPE(FragmentWeights, m);
// EXPORT_PROPERTY_TYPE(pt::FragmentWeightsTraits, m);
EXPORT_PROPERTY_TYPE(ConnectivityTable, m);
// EXPORT_PROPERTY_TYPE(pt::ConnectivityTableTraits, m);
EXPORT_PROPERTY_TYPE(BrokenBonds, m);
// EXPORT_PROPERTY_TYPE(pt::BrokenBondsTraits, m);
EXPORT_PROPERTY_TYPE(Intersections, m);
// EXPORT_PROPERTY_TYPE(pt::IntersectionTraits, m);
Copy link
Contributor

@ryanmrichard ryanmrichard Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comments and add back the pt namespace.

Suggested change
EXPORT_PROPERTY_TYPE(CappedFragments, m);
// EXPORT_PROPERTY_TYPE(pt::CappedFragmentsTraits, m);
EXPORT_PROPERTY_TYPE(NuclearGraphToFragments, m);
// EXPORT_PROPERTY_TYPE(pt::NuclearGraphToFragmentsTraits, m);
EXPORT_PROPERTY_TYPE(NuclearGraph, m);
// EXPORT_PROPERTY_TYPE(pt::NuclearGraphTraits, m);
EXPORT_PROPERTY_TYPE(FragmentedNuclei, m);
// EXPORT_PROPERTY_TYPE(pt::FragmentedNucleiTraits, m);
EXPORT_PROPERTY_TYPE(FragmentedChemicalSystem, m);
// EXPORT_PROPERTY_TYPE(pt::FragmentedChemicalSystemTraits, m);
EXPORT_PROPERTY_TYPE(FragmentWeights, m);
// EXPORT_PROPERTY_TYPE(pt::FragmentWeightsTraits, m);
EXPORT_PROPERTY_TYPE(ConnectivityTable, m);
// EXPORT_PROPERTY_TYPE(pt::ConnectivityTableTraits, m);
EXPORT_PROPERTY_TYPE(BrokenBonds, m);
// EXPORT_PROPERTY_TYPE(pt::BrokenBondsTraits, m);
EXPORT_PROPERTY_TYPE(Intersections, m);
// EXPORT_PROPERTY_TYPE(pt::IntersectionTraits, m);
using namespace pt;
EXPORT_PROPERTY_TYPE(CappedFragments, m);
EXPORT_PROPERTY_TYPE(NuclearGraphToFragments, m);
EXPORT_PROPERTY_TYPE(NuclearGraph, m);
EXPORT_PROPERTY_TYPE(FragmentedNuclei, m);
EXPORT_PROPERTY_TYPE(FragmentedChemicalSystem, m);
EXPORT_PROPERTY_TYPE(FragmentWeights, m);
EXPORT_PROPERTY_TYPE(ConnectivityTable, m);
EXPORT_PROPERTY_TYPE(BrokenBonds, m);
EXPORT_PROPERTY_TYPE(Intersections, m);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this previously and ended up with a syntax error within python due to the double colon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. That's my bad. Try my edit.

}

} // namespace ghostfragment
Loading