Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for simple example data and script. #1

Open
swayson opened this issue Mar 1, 2017 · 2 comments
Open

Request for simple example data and script. #1

swayson opened this issue Mar 1, 2017 · 2 comments

Comments

@swayson
Copy link

swayson commented Mar 1, 2017

Hi there,

Recently read your paper and really great work. I wanted to give the code a try. At the moment, I tried to follow the example in the manual you created but seem to get NoneType errors. Haven't spend time digging into the code, to exactly what is going on, but wanted to try my luck and ask you if you could perhaps create a simple input file and example script to toy around with?

I tried this:

The input file:

0,1,A,B
0,2,A,C
1,1,B,D
1,4,B,C

This gave no errors.

$ python events.py /tmp/data.csv /tmp/input.sqlite -t 0 -w 1

But here is where things went wrong.

python dynsnap.py /tmp/input.sqlite input.out -p -w -1
# file loaded: /tmp/input.sqlite
# Total time range: None None
# Columns: tlow thigh dt sim number_of_events
Traceback (most recent call last):
  File "dynsnap.py", line 1260, in <module>
    main(argv=sys.argv[1:], return_output=False)
  File "dynsnap.py", line 1160, in main
    x = finder.find()
  File "dynsnap.py", line 480, in find
    if self.tstart >= self.tstop:
TypeError: unorderable types: NoneType() >= NoneType()
@rkdarst
Copy link
Owner

rkdarst commented Mar 28, 2017

Hi,

I've finally looked into this and here's my analysis:

First, the code uses space separations, not comma separations. So when it tried to run, it did nothing but create an empty DB. Then, events.py acts as a cache system: if it sees there is already a DB there, it does nothing. So future runs probably returned silently without giving note that the DB was empty.

Then, when you run dynsnap.py, it fails because there are no events. In this case, it happened to use "None" as the start and end times. In python2, these are orderable, but you get the error you saw in python3. I've tried to make things python3 compatible, but I guess that path wasn't tested.

I've done the following:

  • Added a --separator option, which can be used to specify ',' as a separator. Note that it's a dumb .split().
  • Added a check, dynsnap.py will raise an error if there are no events within the database. This should provide error checking so it's obvious if an import failed.

Is this a proper analysis?

I've made some new commits now but haven't fully tested, I should in the next few days.

Thanks for the good report,

  • Richard

@LanlanYu11
Copy link

hello,
Recently I read your paper and tried to follow the example in the your paper. I got the same result, when I used the data of the Enron_mail. But unfortunately, use the Reality mining, the result is different.
I have data from the personal devices of the 94 subject, contains 759914 unique readings from 2004/1/1 until 2005/7/14. Use the day as unit , inconceivably, I got the four time slices.....
`python dynsnap.py input.sqlite input.out -w -1

file loaded: input.sqlite

Total time range: 0 560

Columns: tlow thigh dt sim number_of_events

0 330.0 330.0 0.321510498169 5010
330.0 430.0 100.0 0.345930733212 3489
430.0 540.0 110.0 0.312115168681 1382
540.0 560.0 20.0 0.00175915835 14`
I really need your help.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@swayson @rkdarst @LanlanYu11 and others