• Akasha Peppermint's avatar
    Major project refactoring to resolve import issues: · f57c4fc9
    Akasha Peppermint authored
    This was done due to python being picky about where it loaded modules, so while scripts in submodules would work fine, running a submodule dependency from the parent initiator_set folder would result in ImportErrors. There is no other solution other than messing around with the PYTHONPATH / sys.path etc.
    
    With this change you can have runnable scripts inside the submodules, as as runnable scripts outside the submodules and in other submodules, without having to manually mess around with sys.path in the __init__.py file (granted, for running within submodules you need to have 2 extra lines of code just before you import things from initiator set)
    
    A pip package called repackage helps solve these issues by implementing their own version of a relative import system, which eliminates discrepancies with import with IDE vs command line (IDE manages its own PYTHONPATH)
    
    Pipenv was introduced, we might need it later anyways because of GUI
    
    - Added blank __init__.py to every submodule to let python treat all submodules as packages
    - Blanked out all __init__.py logic, because when importing __init__.py from different locations python does not know which __init__.py file to choose to import
    - Removed any " from __init__.py import * " statements
    - Removed __init__.py from root initiator_set folder (or else python thinks it's a package)
    
    - Added " from repackage import up \n up() " to every test script inside the submodules - this forces python to search modules from the root initiator_set folder and enables runnable code to be located inside packages while having the package code still work outside of it.
    
    - Replaced all import statements to have them all start relative to the initiator_set directory
    - Replaced most wildcard * imports with exact imports. * seems to recursively import.
    
    - Had to change and blank out some file loading logic
    f57c4fc9
Name
Last commit
Last update
..
annotation_matcher Loading commit data...
fasta Loading commit data...
folding_structures_pred Loading commit data...
func_comp_pred_proteins Loading commit data...
gc_count Loading commit data...
genetic_data_inputs Loading commit data...
kozak_calculator Loading commit data...
leaky_scan_detector Loading commit data...
map_aic Loading commit data...
protein_targeting_and_localisation Loading commit data...
ribosomal_assembly_check Loading commit data...
uorf_prox Loading commit data...
util Loading commit data...
initiator_set.py Loading commit data...