Skip to content

Commit cbf2520

Browse files
Merge pull request #62 from pnnl/v103
updating urls for data for tutorials
2 parents fd3a889 + 42c4e97 commit cbf2520

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed
0 Bytes
Binary file not shown.

hypernetx/utils/toys/harrypotter.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,21 @@ class HarryPotter(object):
1616
def __init__(self, cols=None):
1717

1818
# Read dataset in using pandas. Fix index column or use default pandas index.
19+
<<<<<<< HEAD
20+
try:
21+
fname = "https://raw.githubusercontent.com/pnnl/HyperNetX/master/hypernetx/utils/toys/HarryPotter_Characters.csv"
22+
harrydata = pd.read_csv(fname, encoding="unicode_escape")
23+
except:
24+
fname = f'{current_dir}/HarryPotter_Characters.csv'
25+
harrydata = pd.read_csv(fname, encoding="unicode_escape")
26+
=======
1927
# try:
2028
# fname = "HarryPotter_Characters.csv"
2129
# harrydata = pd.read_csv(f'{current_dir}/{fname}', encoding="unicode_escape")
2230
# except:
2331
fname = "https://raw.githubusercontent.com/pnnl/HyperNetX/master/hypernetx/utils/toys/HarryPotter_Characters.csv"
2432
harrydata = pd.read_csv(fname, encoding="unicode_escape")
33+
>>>>>>> master
2534
self.harrydata = pd.DataFrame(harrydata)
2635

2736
# Choose string to fill NaN. These will be set to 0 in system id = sid

hypernetx/utils/toys/transmission_problem.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
__all__ = ['TransmissionProblem']
66

7-
csvfile = 'ChungLuTransmissionData.csv'
8-
csvfile = os.path.join(os.path.dirname(__file__), csvfile)
7+
current_dir = os.path.dirname(os.path.abspath(__file__))
98

109

1110
class TransmissionProblem(object):
12-
def __init__(self, csvfile=csvfile):
13-
csvfile = csvfile
11+
def __init__(self):
12+
1413
try:
14+
csvfile = "https://raw.githubusercontent.com/pnnl/HyperNetX/master/hypernetx/utils/toys/ChungLuTransmissionData.csv"
1515
self.df = pd.read_csv(csvfile, header=None, names=['receivers', 'senders'])
1616
except:
17-
fname = "https://raw.githubusercontent.com/pnnl/HyperNetX/master/hypernetx/utils/toys/ChungLuTransmissionData.csv"
18-
self.df = pd.read_csv(fname, header=None, names=['receivers', 'senders'])
17+
csvfile = f'{current_dir}/ChungLuTransmissionData.csv'
18+
self.df = pd.read_csv(csvfile, header=None, names=['receivers', 'senders'])

tutorials/Tutorial 6 - Static Hypergraphs and Entities.ipynb

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)