Skip to content

Commit

Permalink
Incorporate module import enhancement.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Jul 9, 2024
1 parent 7ac34e7 commit 0393f17
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 1 deletion.
4 changes: 4 additions & 0 deletions edu.cuny.hunter.hybridize.tests/.pydevproject
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
<path>/${PROJECT_DIR_NAME}/resources/HybridizeFunction/testModule5/in</path>
<path>/${PROJECT_DIR_NAME}/resources/HybridizeFunction/testModule6/in</path>
<path>/${PROJECT_DIR_NAME}/resources/HybridizeFunction/testModule7/in</path>
<path>/${PROJECT_DIR_NAME}/resources/HybridizeFunction/testModule17/in</path>
<path>/${PROJECT_DIR_NAME}/resources/HybridizeFunction/testModule18/in</path>
<path>/${PROJECT_DIR_NAME}/resources/HybridizeFunction/testModule19/in</path>
<path>/${PROJECT_DIR_NAME}/resources/HybridizeFunction/testModule20/in</path>
</pydev_pathproperty>
</pydev_project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import ones
from src import f

f(ones([1, 2]))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tensorflow==2.9.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import Tensor


def f(a):
assert isinstance(a, Tensor)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .B import f
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import ones
from src import f

f(ones([1, 2]))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tensorflow==2.9.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import Tensor


def f(a):
assert isinstance(a, Tensor)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .B import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import ones
from src import C

C().f(ones([1, 2]))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tensorflow==2.9.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import Tensor


class C:

def f(self, a):
assert isinstance(a, Tensor)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .B import C
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import ones
from src import C

C().f(ones([1, 2]))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tensorflow==2.9.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import Tensor


class C:

def f(self, a):
assert isinstance(a, Tensor)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .B import *
Original file line number Diff line number Diff line change
Expand Up @@ -7525,6 +7525,54 @@ public void testModule16() throws Exception {
assertTrue(function.getHasTensorParameter());
}

@Test
public void testModule17() throws Exception {
Set<Function> functions = this.getFunctions("src/B");
assertEquals(1, functions.size());
Function function = functions.iterator().next();

assertEquals("f", function.getIdentifier());
assertEquals(1, function.getNumberOfParameters());
assertFalse(function.isMethod());
assertTrue(function.getHasTensorParameter());
}

@Test
public void testModule18() throws Exception {
Set<Function> functions = this.getFunctions("src/B");
assertEquals(1, functions.size());
Function function = functions.iterator().next();

assertEquals("f", function.getIdentifier());
assertEquals(1, function.getNumberOfParameters());
assertFalse(function.isMethod());
assertTrue(function.getHasTensorParameter());
}

@Test
public void testModule19() throws Exception {
Set<Function> functions = this.getFunctions("src/B");
assertEquals(1, functions.size());
Function function = functions.iterator().next();

assertEquals("C.f", function.getIdentifier());
assertEquals(2, function.getNumberOfParameters());
assertTrue(function.isMethod());
assertTrue(function.getHasTensorParameter());
}

@Test
public void testModule20() throws Exception {
Set<Function> functions = this.getFunctions("src/B");
assertEquals(1, functions.size());
Function function = functions.iterator().next();

assertEquals("C.f", function.getIdentifier());
assertEquals(2, function.getNumberOfParameters());
assertTrue(function.isMethod());
assertTrue(function.getHasTensorParameter());
}

@Test
public void testBooleanMask() throws Exception {
Set<Function> functions = this.getFunctions();
Expand Down
2 changes: 1 addition & 1 deletion hybridize.target
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>com.ibm.wala</groupId>
<artifactId>com.ibm.wala.cast.python.ml</artifactId>
<version>0.35.0-SNAPSHOT</version>
<version>0.36.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
</dependencies>
Expand Down

0 comments on commit 0393f17

Please sign in to comment.