Giter Club home page Giter Club logo

Comments (2)

joeyagreco avatar joeyagreco commented on June 15, 2024

Check this out: https://github.com/joeyagreco/leeger/blob/main/example/league_loader/nameChanges.py

from leeger.

ryan-gillies avatar ryan-gillies commented on June 15, 2024

I'm also getting a key error when trying to compile an all-time statsheet from Sleeper. I don't have any users that changed usernames, but do have several owners leaving and new owners from one year to the next.

Error Logs

Traceback (most recent call last):
File "/Users/ryan.gillies/Documents/side_judge/backend/models/league.py", line 91, in _load_leeger
leagueStats: AllTimeStatSheet = leagueStatSheet(leeger, validate = True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ryan.gillies/Documents/side_judge/.venv/lib/python3.11/site-packages/leeger/util/stat_sheet.py", line 81, in leagueStatSheet
maxScoringShare = ScoringShareAllTimeCalculator.getMaxScoringShare(league, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ryan.gillies/Documents/side_judge/.venv/lib/python3.11/site-packages/leeger/decorator/validators.py", line 38, in wrapFunction
return function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ryan.gillies/Documents/side_judge/.venv/lib/python3.11/site-packages/leeger/calculator/all_time_calculator/ScoringShareAllTimeCalculator.py", line 143, in getMaxScoringShare
maxScoringSharesByYear[yearNumber][ownerId]
KeyError: '506256e003f911efba5b5af986bf8fed'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^

Code

def _load_leeger(self):
        from leeger.league_loader import SleeperLeagueLoader
        from leeger.model.league import League, Year
        from leeger.model.stat.YearStatSheet import YearStatSheet
        from leeger.util.stat_sheet import yearStatSheet, leagueStatSheet
        from leeger.model.stat.AllTimeStatSheet import AllTimeStatSheet
        league_loader = SleeperLeagueLoader(self.league_id, self.years)
        leeger: League = league_loader.loadLeague()
        from leeger.model.stat.AllTimeStatSheet import AllTimeStatSheet
        from leeger.util.stat_sheet import leagueStatSheet
        try:
            leagueStats: AllTimeStatSheet = leagueStatSheet(leeger, validate = True)
        except KeyError:
            import traceback
            traceback.print_exc()
        return leeger

from leeger.

Related Issues (14)

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.