Skip to content

Commit

Permalink
Pre-compile Python code and remove source from container.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkalescky committed May 1, 2024
1 parent 3f8d4d2 commit e925832
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ WORKDIR /purva
COPY --from=build lmodea/lmodea.exe lm90.test.exe
COPY src .

# Generate Python cache and remove source
RUN python3 -m compileall -b . &&\
rm *.py

# Run pURVA scripts
ENTRYPOINT ["python3", "/purva/main.py"]
ENTRYPOINT ["python3", "/purva/main.pyc"]

20 changes: 10 additions & 10 deletions src/fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1754,16 +1754,16 @@ def rdcmd(inpf,cmdgui): #,oldnew,nBrowsf,oBrowsf,xyzf, \
cmdgui.Basename = cmdgui.Basename + "/"

# Test whether the folder exist
if not os.path.isdir(cmdgui.Basename):
stop("Error: folder not exist- "+cmdgui.Basename)
if not os.path.exists(cmdgui.Basename+"main.py"):
stop("Error: could not find pURVA in "+cmdgui.Basename)
if not os.path.exists(cmdgui.Basename+"inter_removespikes_main.py"):
stop("Error: RMSPK module missing in "+cmdgui.Basename)
if not os.path.exists(cmdgui.Basename+"inter_autosmooth_main.py"):
stop("Error: AUTOSMTH module missing in "+cmdgui.Basename)
if not os.path.exists(cmdgui.Basename+"lm90.test.exe"):
stop("Error: ADIABLM module missing in "+cmdgui.Basename)
# if not os.path.isdir(cmdgui.Basename):
# stop("Error: folder not exist- "+cmdgui.Basename)
# if not os.path.exists(cmdgui.Basename+"main.py"):
# stop("Error: could not find pURVA in "+cmdgui.Basename)
# if not os.path.exists(cmdgui.Basename+"inter_removespikes_main.py"):
# stop("Error: RMSPK module missing in "+cmdgui.Basename)
# if not os.path.exists(cmdgui.Basename+"inter_autosmooth_main.py"):
# stop("Error: AUTOSMTH module missing in "+cmdgui.Basename)
# if not os.path.exists(cmdgui.Basename+"lm90.test.exe"):
# stop("Error: ADIABLM module missing in "+cmdgui.Basename)



Expand Down

0 comments on commit e925832

Please sign in to comment.