On 25 July 2011 13:15, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> On Jul 25, 2011, at 12:06 PM, Matthew Knepley wrote:
>
>> On Mon, Jul 25, 2011 at 4:56 PM, Sean Farley <sean at mcs.anl.gov> wrote:
>> I disagree with this completely. ?There's a tendency to think of everything 
>> python as a package -- this is NOT a package. ?It has no __init__.py, it has 
>> no __all__, it has no submodules, and it doesn't need any of that. ?It 
>> simply does a one-off task -- it's bits of code to be used in a script. 
>> ?Putting this sort of code in site-packages is what makes site-packages the 
>> nightmare of ignored dependencies and overlapping versions it is today.
>>
>> If you want to make it into a package, you're welcome to do so. ?With that 
>> includes registration with the cheeseshop to make sure the namespace is 
>> unique, placing the single file within a folder that includes an __init__ 
>> (and then likely just gets imported within that __init__), writing a 
>> setup.py, etc etc. ?It's just complete overkill.
>>
>> Then why put it in bin/python at all? Just drop the .py extension and put it 
>> in bin (with a 'correct' [whatever that may be] python hashbang)?
>
> ? Because directories are a useful way to organize categories of software 
> (for example the bin/matlab directory has all the Matlab scripts). Why not 
> just not use subdirectories in PETSc and just stick all PETSc files directly 
> into the PETSc root directory?
>

1) IMHO, using subdirectories in bin/ does not look good. I think we
should have lib/matlab and lib/python. As long as the code in
lib/python works with many different Python versions, that location
looks fine for me. bin/ is not the right place to add new directories
with stuff, you should put there just shebang scripts with execute
permissions.

2) You simply cannot drop the .py extension from PetscBinaryRead.py .
That code it is not a script intended to be run, but to be imported
from other Python codes. If you remove the .py ext, Python import will
not be able to locate PetscBinaryRead.


-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169

Reply via email to