This repository was archived by the owner on Apr 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +21
-3
lines changed
Expand file tree Collapse file tree 5 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =' 1.0' encoding =' windows-1252' standalone =' yes' ?>
2+
3+ <root >
4+ <creator application =' PLS-CADD' version =' ' registereduser =' ' date =' ' time =' ' computer =' ' user =' ' project =' ' projectpath =' ' activeline =' ' coordinatesystem =' ' zone =' ' zonedsescription =' ' gridshift =' ' surveyfoot =' ' schemafile =' ' plsxmlver =' 1.0' />
5+ <table plsname =' Galloping Summary' tagname =' galloping_summary' ncols =' 5' nrows =' 0' units =' 0' version =' 1' titledetail =' ' >
6+ </table >
7+ </root >
Original file line number Diff line number Diff line change 1515 galloping_zip = dict (
1616 file = 'galloping.zip' ,
1717 tables = None
18+ ),
19+ galloping_empty = dict (
20+ file = 'galloping_empty.xml' ,
21+ tables = None
1822 )
1923)
2024
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def is_xml(p):
9999
100100 _print = self ._print_func ()
101101 valid_ext = {'.xml' } # Valid extensions
102- excl_ext = re .compile ('__MACOSX|\.' ) # Excluded regex expressions
102+ excl_ext = re .compile (r '__MACOSX|\.' ) # Excluded regex expressions
103103
104104 if tables is not None :
105105 if isinstance (tables , str ):
@@ -213,7 +213,8 @@ def convert_type(data):
213213 else :
214214 self [k ] = pd .DataFrame .from_dict (d )
215215 # Create new dataframe with columns in order.
216- self [k ] = self [k ][list (d [0 ])].copy ()
216+ if d :
217+ self [k ] = self [k ][list (d [0 ])].copy ()
217218
218219 def table_summary (self ):
219220 """
Original file line number Diff line number Diff line change @@ -54,3 +54,9 @@ def test_verbose():
5454def test_load_data ():
5555 for x in data_names ():
5656 xml = load_data (x )
57+
58+
59+ def test_empty_table ():
60+ path = data_path ('galloping_empty' )
61+ xml = PLSXML (path , verbose = True )
62+ assert len (xml .keys ()) == 1
Original file line number Diff line number Diff line change 11[pytest]
2- DJANGO_SETTINGS_MODULE = settings
2+ # DJANGO_SETTINGS_MODULE = settings
33python_files = tests.py test_*.py *_test.py
You can’t perform that action at this time.
0 commit comments