Skip to content

Commit

Permalink
Merge branch 'origin/feature/fix_element_ordering_issue#35' of https:…
Browse files Browse the repository at this point in the history
…//github.com/GEOS-DEV/geosPythonPackages into origin/feature/fix_element_ordering_issue#35
  • Loading branch information
alexbenedicto committed Sep 16, 2024
2 parents 270f9b8 + fa65f8a commit 601170d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions geos-ats/src/geos/ats/helpers/curve_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ def interpolate_values_time( ta, xa, tb ):
"""
N = list( np.shape( xa ) )
M = len( tb )
ta = np.ascontiguousarray( np.squeeze( ta ) )
tb = np.ascontiguousarray( np.squeeze( tb ) )

if ( len( N ) == 1 ):
return interp1d( ta, xa )( tb )
else:
# Reshape the input array so that we can work on the non-time axes
S = np.product( N[ 1: ] )
S = np.prod( N[ 1: ] )
xc = np.reshape( xa, ( N[ 0 ], S ) )
xd = np.zeros( ( len( tb ), S ) )
for ii in range( S ):
xd[ :, ii ] = interp1d( ta, xc[ :, ii ] )( tb )
xd[ :, ii ] = interp1d( ta, xc[ :, ii ], bounds_error=False, fill_value='extrapolate' )( tb )

# Return the array to it's expected shape
N[ 0 ] = M
Expand Down
13 changes: 9 additions & 4 deletions geos-ats/src/geos/ats/test_case.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ats # type: ignore[import]
import ats # type: ignore[import]
import os
import shutil
import logging
Expand Down Expand Up @@ -319,7 +319,7 @@ def testCreate( self ):
priority = 1

# Setup a new test group
atsTest = None
parent_test = None
ats.tests.AtsTest.newGroup( priority=priority, path=self.path )
for stepnum, step in enumerate( self.steps ):
np = getattr( step.p, "np", 1 )
Expand All @@ -329,10 +329,10 @@ def testCreate( self ):
label = "%s_%d_%s" % ( self.name, stepnum + 1, step.label() )

# call either 'test' or 'testif'
if atsTest is None:
if parent_test is None:
func = lambda *a, **k: test( *a, **k )
else:
func = lambda *a, **k: testif( atsTest, *a, **k )
func = lambda *a, **k: testif( parent_test, *a, **k )

# Set the time limit
kw = {}
Expand All @@ -359,6 +359,11 @@ def testCreate( self ):
if self.last_status == PASSED:
atsTest.status = SKIPPED

# Set the parent test
# Note: do not make tests dependent on the result of curvecheck
if step.label() != 'curvecheck':
parent_test = atsTest

# End the group
ats.tests.AtsTest.endGroup()

Expand Down

0 comments on commit 601170d

Please sign in to comment.