Skip to content
Snippets Groups Projects
Commit 5d8288cb authored by Matthias Puchner's avatar Matthias Puchner
Browse files

handle inconsistent naming of formfactors for python code generation

parent 37e74c45
No related branches found
No related tags found
1 merge request!65Refactor Distribution Handling
......@@ -13,6 +13,7 @@
// ************************************************************************************************
#include "Sample/Scattering/IFormFactor.h"
#include "Base/Utils/StringUtils.h"
#include "Param/Base/RealParameter.h"
#include "Sample/Material/WavevectorInfo.h"
#include "Sample/RT/ILayerRTCoefficients.h"
......@@ -78,7 +79,12 @@ Eigen::Matrix2cd IFormFactor::evaluatePol(const WavevectorInfo&) const
std::string IFormFactor::pythonConstructor() const
{
return "FormFactor" + getName() + "(" + RealParameter::asPythonArgumentList(m_params) + ")";
// #bapool + check whether the following should be changed
// Some formfactor names (returned by getName()) are named in a different way than others: They
// are prepended by "FormFactor", the others aren't.
return (StringUtils::startsWith(getName(), "FormFactor") ? "" : "FormFactor") + getName() + "("
+ RealParameter::asPythonArgumentList(m_params) + ")";
}
double IFormFactor::volume() const
......
......@@ -57,7 +57,7 @@ public:
virtual Eigen::Matrix2cd evaluatePol(const WavevectorInfo& wavevectors) const;
//! Creates the Python constructor of this class (or derived classes)
std::string pythonConstructor() const;
virtual std::string pythonConstructor() const;
#endif
//! Returns the total volume of the particle of this form factor's shape
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment