Giter Site home page Giter Site logo

jatkinson1000 / archeryutils Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 3.0 516 KB

A collection of archery code and utilities in python

Home Page: https://archeryutils.readthedocs.io

License: MIT License

Python 90.21% Jupyter Notebook 9.79%
archery python sport

archeryutils's People

Contributors

jatkinson1000 avatar liampattinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

archeryutils's Issues

New indoor classifications

Outfit the code in preparation for the new indoor classifications:

  • Deprecate current outdoor functions
  • Update json data files to have indoor and outdoor data
    • Update existing classification functions to use new parameters for outdoors
  • Implement new indoor classification structure
    • start with dict formed identical as outdoor
      • update ages to be a functions
      • Investigate new parameters
    • Get classification and scores needs to:
      • Handle trad/flatbow/asiatic
      • handle [ ] triple faces and [ ] compound scoring
        • WA
        • Portsmouth
        • Stafford
        • Other?
  • Xs on Worcester and Vegas? - May be separate issue...

Units for target face diameter

Discussed in #17

  • Add option for user to specify target face diameter unit
  • Set default to be [cm]
  • Store under the hood as [m] to preserve SI and not affect code elsewhere

This requires:

  • Add optional argument to Target class
  • Add conversion code as part of __init__ in Target class
  • Add INCHES2M and CM2M to constants file
  • Add tests for conversion process
  • Update and round data files accordingly

hc_eq.score_for_round should not return a tuple

Currently hc_eq.score_for_round returns a tuple of the score for the round and the score for each distance.
This is not an intuitive use, however.

Need a function hc_eq.score_for_round that returns just a score.
Need a new function hc_eq.score_for_round_distances that returns an array.

Need to rectify this soon as it will have a lot of knock on effects elsewhere such as classifications and generating handicap tables.

Bug in Vegas300 round

Vegas 300 gives wrong scores for handicaps as it is using 18 m, not 20 yds.

See AGB Rules of Shooting.

Better tests needed for Archery Australia Algorithm

Currently there is no easily and reliable data available for the Archery Australia Algorithms so there are no tests against external values in the code for this algorithm.

AA officially uses Archer's Diary for ratings, but there are inconsistencies in the results which I have raised as a bug report there.
Bow international published an article with decimal numbers but these do not match our results (approx 0.15 out), though this could be due to differences in rounding procedures between codes.

Consider searching for external sources or contacting James Park.

Refactor classifications

Classifications has grown to become rather behemothic.
Consider refactoring into separate files for each classification.

Simplify importing classes/functions

I think it'd be a good idea to expose some classes/functions to the top-level namespace. It'd be nice if we could do stuff like:

import archeryutils as au
my_target = au.Target(...)

We'll have to be fairly selective though, as most of the internals probably don't need to be part of the user API.

Project Documentation needs improving

Currently very sparse project documentation.
Add information on how to:

  • install
  • use
  • contribute - ownership etc.
  • code of conduct
  • license
  • run examples - update the examples file!!
  • support
  • coverage and formatting badges

Get CI green (address pylint)

Currently the CI checks fail for pylint (added in #25 ).
Whilst some of these are legitimate to ignore (variable names) others hint at the need for some refactoring and will be addressed in some other issues.

After looking at these we should then return to place any ignores that we feel are legitimately warranted.

Issues to tackle that will help address this:

Single Classification wrapper function

Currently classifications are called depending on the type of classification required.

Consider a single generic wrapper function that can be called that then recursively calls the existing functions.

Round object has to be defined with a name

At present a Round object has to defined with a name and a list of Passes.
However, for abstract use we may just want to define passes and no name.
Consider a refactor to make name an optional argument.

Will have knock on effects where Round is used as calls will need to change.
Breaking change?

Requires:

  • Review how much of a breaking change this will be
  • Update Rounds.py Round class
  • Update Rounds tests
  • Update knock on effects in rest of code
  • Update any archerycalculator code affected
  • Notify of changes in docs?

Support and testing for python <= 3.7

As a result of #25 the minimum python version was set at 3.8 to satisfy the minimum numpy of 1.22, which in turn was required to pass mypy --strict (full type hinting support of internal functions was only added in numpy 1.22).

However, the code runs perfectly fine on python 3.7.

Can we remove mypy as a dependency and install/run it only during the CI process?
And if so can we set things up so that we run CI testing on python <= 3.7, but not mypy?

One Qn - if we do this how do we indicate this in documentation given we will be passing strict mypy, but only on certain versions?

HcParams leads to a complicated interface

It'd be good to hide a lot of the HCParams stuff, maybe by making it an optional argument to the functions that use it, and falling back to default values if it isn't provided. I think the ideal system would be something like:

from archeryutils import score_from_handicap, handicap_from_score, rounds

# Default to current AGB methods
myscore = score_from_handicap(rounds.york, 38)
myhc = handicap_from_score(rounds.portsmouth, 575)

Alternative handicap systems could be used by setting a context using fancy with methods, or as optional args to the standard functions. Or we could just have a global context setter:

archeryutils.set_handicap_system("some_other_method")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.