Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ RUN sudo sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen &&

ENV LANG en_US.UTF-8

RUN echo 32
RUN echo 37

COPY daemons/snetd_topic_kovan.json /home/top/daemons/kovan/
COPY daemons/snetd_topic_ropsten.json /home/top/daemons/ropsten/
Expand All @@ -92,7 +92,7 @@ COPY supervisor/supervisord.conf /etc/supervisor/

WORKDIR /home/top/dep


#USER root

# Can be uncommented for local docker building

Expand Down
6 changes: 3 additions & 3 deletions Docker/supervisor/kovand.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ logfile=/dev/null
nodaemon=true

[program:kovand]
command=./serve --config /home/top/daemons/kovan/snetd_topic_kovan.json
directory=/home/top/daemons/kovan/snetd
user=top
command=/home/top/daemons/kovan/snetd serve --config /home/top/daemons/kovan/snetd_topic_kovan.json
;directory=/home/top/daemons/kovan
user=root
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
Expand Down
6 changes: 3 additions & 3 deletions Docker/supervisor/ropstend.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ logfile=/dev/null
nodaemon=true

[program:ropstend]
command=./serve --config /home/top/daemons/ropsten/snetd_topic_ropsten.json
directory=/home/top/daemons/ropsten/snetd
user=top
command=/home/top/daemons/ropsten/snetd serve --config /home/top/daemons/ropsten/snetd_topic_ropsten.json
;directory=/home/top/daemons/ropsten
user=root
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
Expand Down
3 changes: 2 additions & 1 deletion snet_test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def try_plsa_2():
if __name__ == '__main__':

# try_plsa()
try_plsa_2()
print(sample_data_2())
# try_plsa_2()
# csv_reader()


55 changes: 33 additions & 22 deletions topic_analysis_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,43 @@ def PLSA(self,request,context):
param_error = False
message = ''

if len(docs) < 2:
message = 'Length of docs should be at least two'
param_error =True
try :

if topic_divider < 0:
param_error = True
message = 'topic_divider parameter can not be a negative nubmer'
if len(docs) < 2:
message = 'Length of docs should be at least two'
param_error =True

if topic_divider == 0 and num_topics < 2:
param_error = True
message = 'Number of topics should be at least two'
if topic_divider < 0:
param_error = True
message = 'topic_divider parameter can not be a negative nubmer'

if maxiter < 0:
param_error = True
message = 'maxiter should be greater than zero'
if topic_divider == 0 and num_topics < 2:
param_error = True
message = 'Number of topics should be at least two'

if beta < 0 or beta > 1:
param_error = True
message = 'beta should have value of (0,1]'
if maxiter < 0:
param_error = True
message = 'maxiter should be greater than zero'

if beta < 0 or beta > 1:
param_error = True
message = 'beta should have value of (0,1]'

if param_error:
return topic_analysis_pb2.PLSAResponse(status=False, message=message)

if param_error:
print(time.strftime("%c"))
print('Waiting for next call on port 5000.')
raise grpc.RpcError(grpc.StatusCode.UNKNOWN, message)


except Exception as e:

logging.exception("message")

print(time.strftime("%c"))
print('Waiting for next call on port 5000.')

raise grpc.RpcError(grpc.StatusCode.UNKNOWN, str(e))



Expand All @@ -95,13 +109,10 @@ def PLSA(self,request,context):

logging.exception("message")

resp = topic_analysis_pb2.PLSAResponse(status=False, message=str(e))

print('status:', resp.status)
print('message:', resp.message)
print(time.strftime("%c"))
print('Waiting for next call on port 5000.')

return resp
raise grpc.RpcError(grpc.StatusCode.UNKNOWN, str(e))


def generate_topics_plsa(docs,unique_folder_naming,num_topics,topic_divider,maxiter,beta):
Expand Down