QUT-Digital-Observatory / coordination-network-toolkit

A small command line tool and set of functions for studying coordination networks in Twitter and other social media data.
MIT License
72 stars 14 forks source link

Got an unexpected keyword argument 'initializer' #32

Closed havardl closed 2 years ago

havardl commented 2 years ago

Hi, and thank you for providing this tool for others to use!

After I've successfully imported my data to a .csv file and preprocessed it into a .db file, I get the following output when I try to compute co_link or co_retweet:

Calculating a co_retweet network on data.db with the following settings:
    time_window: 60 seconds
    min_edge_weight: 2 co-ocurring messages
    n_cpus: 2 processors
    output_file: retweet_60s.graphml
Ensure the indexes exist to drive the join.
Calculating the co-retweet network

Traceback (most recent call last):
  File "bin/compute_networks", line 8, in <module>
    sys.exit(main())
  File "lib/python3.6/site-packages/coordination_network_toolkit/__main__.py", line 290, in main
    min_edge_weight=args.min_edge_weight,
  File "lib/python3.6/site-packages/coordination_network_toolkit/compute_networks.py", line 385, in compute_co_retweet_parallel
    sqlite_functions=None
  File "lib/python3.6/site-packages/coordination_network_toolkit/compute_networks.py", line 490, in parallise_query_by_user_id
    max_workers=n_processes, initializer=__init, initargs=(lock,)

TypeError: __init__() got an unexpected keyword argument 'initializer'

I've inspected my .db file, which has the following tables after I've used the preprocess command: edge, message_url, resolved_url, metadata

Is there something I missing in the steps here, or might there be something wrong with my setup or data? I'm running Python version 3.6.9 and I installed the package in an existing pipenv-enviroment.

SamHames commented 2 years ago

Turns out there was a bug - we were relying on something that was only added in Python 3.7 for the multiprocessing support.

Try upgrading to the newest version (1.4.3) - hopefully that fixes it.

Also just FYI Python 3.6 will be end-of-life in about a month, we probably won't be attempting to support it much after that.

havardl commented 2 years ago

Thanks for the fast reply. After upgrading my environment to Python 3.7.5 everything worked, so closing this.