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

updating urls for data for tutorials #62

Merged
merged 6 commits into from
Jun 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/build/.doctrees/environment.pickle
Binary file not shown.
9 changes: 9 additions & 0 deletions hypernetx/utils/toys/harrypotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ class HarryPotter(object):
def __init__(self, cols=None):

# Read dataset in using pandas. Fix index column or use default pandas index.
<<<<<<< HEAD
try:
fname = "https://raw.githubusercontent.com/pnnl/HyperNetX/master/hypernetx/utils/toys/HarryPotter_Characters.csv"
harrydata = pd.read_csv(fname, encoding="unicode_escape")
except:
fname = f'{current_dir}/HarryPotter_Characters.csv'
harrydata = pd.read_csv(fname, encoding="unicode_escape")
=======
# try:
# fname = "HarryPotter_Characters.csv"
# harrydata = pd.read_csv(f'{current_dir}/{fname}', encoding="unicode_escape")
# except:
fname = "https://raw.githubusercontent.com/pnnl/HyperNetX/master/hypernetx/utils/toys/HarryPotter_Characters.csv"
harrydata = pd.read_csv(fname, encoding="unicode_escape")
>>>>>>> master
self.harrydata = pd.DataFrame(harrydata)

# Choose string to fill NaN. These will be set to 0 in system id = sid
Expand Down
12 changes: 6 additions & 6 deletions hypernetx/utils/toys/transmission_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

__all__ = ['TransmissionProblem']

csvfile = 'ChungLuTransmissionData.csv'
csvfile = os.path.join(os.path.dirname(__file__), csvfile)
current_dir = os.path.dirname(os.path.abspath(__file__))


class TransmissionProblem(object):
def __init__(self, csvfile=csvfile):
csvfile = csvfile
def __init__(self):

try:
csvfile = "https://raw.githubusercontent.com/pnnl/HyperNetX/master/hypernetx/utils/toys/ChungLuTransmissionData.csv"
self.df = pd.read_csv(csvfile, header=None, names=['receivers', 'senders'])
except:
fname = "https://raw.githubusercontent.com/pnnl/HyperNetX/master/hypernetx/utils/toys/ChungLuTransmissionData.csv"
self.df = pd.read_csv(fname, header=None, names=['receivers', 'senders'])
csvfile = f'{current_dir}/ChungLuTransmissionData.csv'
self.df = pd.read_csv(csvfile, header=None, names=['receivers', 'senders'])
20 changes: 10 additions & 10 deletions tutorials/Tutorial 6 - Static Hypergraphs and Entities.ipynb

Large diffs are not rendered by default.