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

various changes to quiet build warnings #25

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hartb
Copy link

@hartb hartb commented Apr 27, 2020

This PR quiets some build warnings from g++.

It includes a couple commits that are unlikely to affect correctness:

  • quiet signedness comparison build warnings - adjust some int / size_t
    typing to avoid comparisons of different signedness

  • remove some unused variables

It also includes a couple changes that will likely improve correctness (it
would be good to get additional review of these):

  • fix some logical vs bitwise operator cases - fix tests in some if and
    while statements that were using bitwise operators (&, |) where
    probably the logical operators (&&, ||) were intended

  • avoid undefined behavior in SurvivalForest Data get() and getIndex() - these
    could reach end of function without an explicit return, resulting in
    undefined behavior. Appropriate return value not clear in those cases, so
    raise an exception.

A couple remaining build warnings are not addressed by this PR:

  • a few more int vs size_t signedness comparison complaints from
    cython-generated code. These would require only minor changes to
    _coxpy.pyx and _svm.pyx, and regeneration of the cpp files with
    cython. Regenerating with current cython generates very large diffs
    so those changes are not included here.

  • complaints about use of deprecated numpy APIs when building the
    cython-generated sources. Didn't investigate whether this would require
    any pyx code changes or just regeneration with current cython.

hartb added 4 commits April 24, 2020 20:07
Various fixes to avoid build complaints about mixed signedness
in comparisons (as from g++'s -Wsign-compare), mostly between
int and size_t.
Update a few comparisons that use bitwise operators (&, |), where
logical operators (&&, ||) seem intended instead.
SurvivalForest Data implementation's get() and getIndex() functions
can terminate without returning a defined value.

It's not clear what should be returned in the undefined code path
so throw an exception instead.
hartb added a commit to hartb/powerai that referenced this pull request Apr 27, 2020
Add feedstock for pysurvival, an open source package for
Survival Analysis modeling.

See:
- https://www.pysurvival.io/
- https://github.com/square/pysurvival

Include several local fixes, including some that should improve
correctness. See:

square/pysurvival#25
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

Successfully merging this pull request may close these issues.

1 participant