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

Are Steps() bindings consistent? #3851

Open
eisenhauer opened this issue Oct 18, 2023 · 0 comments
Open

Are Steps() bindings consistent? #3851

eisenhauer opened this issue Oct 18, 2023 · 0 comments

Comments

@eisenhauer
Copy link
Member

I was looking at an old issue #987 about Python Steps() and trying to figure out if it was outdated. I suspect so, but I noticed what may be an inconsistency. In Py11Variable.cpp, the Steps() and StepsStart() functions are implemented like this:

size_t Variable::Steps() const
{
    helper::CheckForNullptr(m_VariableBase, "in call to Variable::Steps");
    return m_VariableBase->m_StepsCount;
}

size_t Variable::StepsStart() const
{
    helper::CheckForNullptr(m_VariableBase, "in call to Variable::StepsStart");
    return m_VariableBase->m_StepsStart;
}

but in the C++ bindings the use a different member variable:

    template <>                                                                                    \
    size_t Variable<T>::Steps() const                                                              \
    {                                                                                              \
        helper::CheckForNullptr(m_Variable, "in call to Variable<T>::Steps");                      \
        return m_Variable->m_AvailableStepsCount;                                                  \
    }                                                                                              \
                                                                                                   \
    template <>                                                                                    \
    size_t Variable<T>::StepsStart() const                                                         \
    {                                                                                              \
        helper::CheckForNullptr(m_Variable, "in call to Variable<T>::StepsStart");                 \
        return m_Variable->m_AvailableStepsStart;                                                  \
    }  

Which is right? I suspect the Python bindings are broken because it looks like m_StepsCount/Start are set in SetStepSelection(), so that would have just come from the application, no reason for a Steps() call to retrieve it. This needs to be fixed and probably the python bindings gone over with a fine-toothed comb...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant