Skip to content

Commit

Permalink
Merge pull request #62 from pnnl/v103
Browse files Browse the repository at this point in the history
updating urls for data for tutorials
  • Loading branch information
brendapraggastis authored Jun 26, 2021
2 parents fd3a889 + 42c4e97 commit cbf2520
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
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.

0 comments on commit cbf2520

Please sign in to comment.