chriskuz / rangers_analysis

1 stars 0 forks source link

statdatadict.py updates #8

Open chriskuz opened 3 years ago

chriskuz commented 3 years ago

Test the module during work. Give feedback on what could be included to make our lives easier. Some thoughts for progression:

chriskuz commented 3 years ago

Am trying to use the module on the mika_zibanejad script located in another folder. Module is imported/found correctly when first:

sys.path.insert(1, "../") where the player_statistics folder is a subset of the code folder and where the actual module is loosely located in the code folder. However, after I:

import statddatadict as sdd I am given a FileNotFoundError when the module runs its MoneyPuck class and tries to access the data dictionary JSON. The problem is believed to be the class trying to access the incorrect path (because now as an imported module, it's accessing from a different origin). It could be globalized on my machine, but this will still cause issues in how the module is used in other machines. There may be a way to have the class adapt to this by:

Overall, the module can readily be used in scripts within the code directory, but not within any sub directories or directories above code. If any issues occur, resort to using the JSON file of money-ucb's dictionary for now.