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

Add Enum constants for trait kinds, validators and default values #680

Merged
merged 11 commits into from
Jan 3, 2020

Conversation

corranwebster
Copy link
Contributor

This is an attempt to remove as many magic numbers as possible from the traits source code, plus use new Python 3 features to do it.

Possibly should also add some C constants for validator types to ctraits.c.

@codecov-io
Copy link

codecov-io commented Dec 24, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@13f27de). Click here to learn what that means.
The diff coverage is 90.41%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #680   +/-   ##
=========================================
  Coverage          ?   70.81%           
=========================================
  Files             ?       45           
  Lines             ?     6342           
  Branches          ?     1291           
=========================================
  Hits              ?     4491           
  Misses            ?     1447           
  Partials          ?      404
Impacted Files Coverage Δ
traits/api.py 89.28% <100%> (ø)
traits/has_traits.py 70.16% <100%> (ø)
traits/constants.py 100% <100%> (ø)
traits/trait_base.py 53.78% <100%> (ø)
traits/trait_numeric.py 51.97% <100%> (ø)
traits/traits_listener.py 79.08% <100%> (ø)
traits/trait_handlers.py 60.68% <75.86%> (ø)
traits/traits.py 68.91% <77.77%> (ø)
traits/trait_types.py 66.72% <89.13%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13f27de...c0fdc93. Read the comment docs.

traits/constants.py Outdated Show resolved Hide resolved
traits/constants.py Outdated Show resolved Hide resolved
Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

LGTM; a couple of typos and a suggestion to document the NO_COMPARE, ... constants.

I merged master (badly), fixed the bad merge, and also took the liberty of fixing one remaining use of NO_COMPARE in a test.

@mdickinson
Copy link
Member

Will fix merge conflicts shortly.

@mdickinson mdickinson self-assigned this Jan 3, 2020
@mdickinson
Copy link
Member

Assigning to me for merge conflict resolution, minor updates, and merge.

@mdickinson mdickinson merged commit caad578 into master Jan 3, 2020
@mdickinson mdickinson deleted the enh/add-constants branch January 3, 2020 11:39
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.

3 participants