Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API chnages issue part 2,4,5 #326

Merged
merged 2 commits into from Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions api/python/FebrlExample.py
Expand Up @@ -46,5 +46,4 @@

#Zingg execution for the given phase
zingg = Zingg(args, options)
zingg.init()
zingg.execute()
zingg.initAndExecute()
Empty file added api/python/__init__.py
Empty file.
11 changes: 8 additions & 3 deletions python/phases/zingg.py → api/python/zingg.py
Expand Up @@ -27,6 +27,9 @@ def init(self):
self.client.init()
def execute(self):
self.client.execute()
def initAndExecute(self):
self.client.init()
self.client.execute()
def getMarkedRecords(self):
return self.client.getMarkedRecords()
def getUnMarkedRecords(self):
Expand Down Expand Up @@ -106,9 +109,11 @@ class ClientOptions:
EMAIL = sc._jvm.zingg.client.ClientOptions.EMAIL
LOCATION = sc._jvm.zingg.client.ClientOptions.LOCATION

def __init__(self, arguments):
self.co = sc._jvm.zingg.client.ClientOptions(arguments)

def __init__(self, args = None):
if(args!=None):
self.co = sc._jvm.zingg.client.ClientOptions(args)
else:
self.co = sc._jvm.zingg.client.ClientOptions(["--phase", "trainMatch", "--conf", "dummy", "--license", "dummy", "--email", "xxx@yyy.com"])
def getClientOptions(self):
return self.co
def getOptionValue(self, option):
Expand Down
4 changes: 2 additions & 2 deletions python/phases/assessModel.py
@@ -1,4 +1,4 @@
from zingg import *
from api.python.zingg import *
import pandas as pd
import seaborn as sn
import matplotlib.pyplot as plt
Expand All @@ -16,7 +16,7 @@ def main():
options.setPhase("peekModel")
arguments = Arguments.createArgumentsFromJSON(options.getConf(), options.getPhase())
client = Zingg(arguments, options)
client.init()
client.initAndExecute()

pMarkedDF = client.getPandasDfFromDs(client.getMarkedRecords())
pUnMarkedDF = client.getPandasDfFromDs(client.getUnMarkedRecords())
Expand Down
7 changes: 4 additions & 3 deletions python/phases/exportModel.py
@@ -1,6 +1,7 @@
from zingg import *
import argparse

from api.python.zingg import *
import sys
import argparse
import os

logging.basicConfig(level=logging.INFO)
Expand All @@ -20,7 +21,7 @@ def main():
options.setPhase("peekModel")
arguments = Arguments.createArgumentsFromJSON(options.getConf(), options.getPhase())
client = Zingg(arguments, options)
client.init()
client.initAndExecute()

pMarkedDF = client.getPandasDfFromDs(client.getMarkedRecords())
labelledData = spark.createDataFrame(pMarkedDF)
Expand Down