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

Not all collections will produce all derivatives #10

Closed
ruebot opened this Issue Mar 2, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@ruebot
Copy link
Member

ruebot commented Mar 2, 2019

The notebook(s) need to be updated with conditions if particular derivatives don't exist. Right now, it expects all possible derivatives to be supplied.

@ruebot ruebot added the bug label Mar 4, 2019

@ruebot

This comment has been minimized.

Copy link
Member Author

ruebot commented Mar 5, 2019

At minimum, we produce : a fulltext file, domains file, and graphml file.

We may or may not produce a gexf file depending on how large the graph is, and a user may not have a filtered_text.zip since we introduced that relatively recently.

So, the question is where is the best place wrap a couple things in a try and catch, and catch FileNotFoundError expectations?

@greebie let me know what you think, and if you want to take this on. If you just want to let me know what you think are the best places, I can take care of implementing it.

@greebie

This comment has been minimized.

Copy link
Collaborator

greebie commented Mar 5, 2019

I think the best way is to create a check function that takes a function and runs the try catch.

For instance:

def collectionExists(fn):
       check = True
       try:
           fn()
       catch FileNotFoundError:
         check = False
       return check

Then you can add variable = if (collectionExists(get_text)) get_text([params]) else ["No file available"]

To make this work generally, we will need to include a network function that looks something like this:

def getGexf(file = auk_gephi):
      return nx.read_gexf(auk_gephi) #import the graph
@greebie

This comment has been minimized.

Copy link
Collaborator

greebie commented Mar 5, 2019

I am willing to take this on also. :)

@ianmilligan1

This comment has been minimized.

Copy link
Member

ianmilligan1 commented Mar 5, 2019

Great, thanks @greebie - I assigned you do this. Seems like you've got a good plan above.

@greebie

This comment has been minimized.

Copy link
Collaborator

greebie commented Mar 6, 2019

I'm going to have to wait to wait for #30 otherwise I'll have merging issues.

@greebie

This comment has been minimized.

Copy link
Collaborator

greebie commented Mar 8, 2019

Okay - close to a PR. The approach I took was very similar, but I decided to just show empty graphs on a fail, but included a file checker script to check the existence of all derivative files.

At this stage the notebook is not using either graphml or the filtered text derivatives, but I included functions to check those for future use.

@ianmilligan1

This comment has been minimized.

Copy link
Member

ianmilligan1 commented Mar 14, 2019

Closed with aed4e11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.