Open chriskuz opened 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:
possibly running an embedded sys
script line within the class that pulls relevant system path of the file the module is imported into and then trying to use that as a way to have a bearing on the overall git repository.
possibly moving the statdatadict.py module and moneypuck_datadict.json files into the hockey_env anaconda environment.
letting the user manually specify the relevant path to the dictionary (which may defeat the point of optimizing workflow)
restructuring the class with __init__
methods and somehow using such instantiation to our advantage (with either user input or relying on some sys
methods).
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.
Test the module during work. Give feedback on what could be included to make our lives easier. Some thoughts for progression:
determine an easy way to create a path so that the module could be easily imported into all folders.
create an extended dictionary option to couple with the moneypuck data dictionary to include any created features.
create a citation method to be called upon for quick citation on the file.
edit the actual json for certain descriptions involving "see description above" to avoid issues in parsing through different features.
maybe create a "hints" method for specific keyword searches
create a docstring.