Project

General

Profile

Actions

Feature #1137

closed

running appion script in another appion script

Added by Anchi Cheng over 13 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
01/13/2011
Due date:
% Done:

0%

Estimated time:

Description

I want this for the auto tomograghy pipeline. Wonder if this is generally useful that I ought to put it in appionScript base class. Also maybe it is there already?

The input is command and the path for its appionsub.runname.log file.

Will use the typical supprocess

Actions #1

Updated by Anchi Cheng over 13 years ago

  • Assignee set to Neil Voss
Actions #2

Updated by Neil Voss over 13 years ago

What do you want me to do?

Actions #3

Updated by Anchi Cheng over 13 years ago

Just want to know if you have already something like this in place and if you see any problem in doing so. If it is not done yet and you agree with me that it is reasonable to make it general, Assign it back to me.

Actions #4

Updated by Neil Voss over 13 years ago

I have done this before, but I do not think I have done it for anything in production. Since you cannot reliably 'import makestack2' because the appion bin directory is not in the PYTHONPATH, I would have called it using the subprocess.Popen command.

For example in satEuler.py, I run the appionScript program satAverage.py. Which not yet part of the pipeline.

Actions #5

Updated by Anchi Cheng over 13 years ago

  • Status changed from New to In Code Review

r15333 moved my runAppionScriptInSubprocess in tomoautorecon.py to appionscript.py so that other appion scripts can call it. It is still a problem if appionwrapper is used to modify $PATH and $PYTHONPATH because I had to use shell=True for python 2.4. Jim's python 2.6 works with sell=False. We will have to solve this problem some day. Will open a separate issue for this general problem.

Neil, if you don't have time to code review, you can assign to someone else. I just thought you would be the best person since you have done it before.

Actions #6

Updated by Neil Voss over 13 years ago

Hey Anchi, when proc.communicate() is called does the python wait for the function to finish? I ask because you have the 60 second check loop.

Also, what if you are running a program that takes 3 seconds to run, do you really want to wait 60 seconds. I use a power series in the spyder.py method.

Otherwise, I think it would be a useful function.

Actions #7

Updated by Neil Voss over 13 years ago

Actually I use a geometric series, power series has too much growth.

Actions #8

Updated by Anchi Cheng over 13 years ago

  • Status changed from In Code Review to Assigned
  • Assignee changed from Neil Voss to Anchi Cheng

So far the two scripts I ran indicated that proc.communicate does wait for the process to finish since it went through without obvioius delay for that 60 seconds, I don't remember where I got that 60 sec wait idea from, but I do like your geometric series idea. Will put that in.

Actions #9

Updated by Anchi Cheng about 12 years ago

  • Status changed from Assigned to In Code Review
  • Assignee changed from Anchi Cheng to Jim Pulokas
  • Target version set to Appion/Leginon 2.2.0

Has been used in tomoautorecon for a while now without problem. Can be closed after review.

Actions #10

Updated by Anchi Cheng over 6 years ago

  • Status changed from In Code Review to Closed
Actions

Also available in: Atom PDF