[ 
https://issues.apache.org/jira/browse/CLIMATE-536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14181003#comment-14181003
 ] 

Cameron Goodale commented on CLIMATE-536:
-----------------------------------------

Kim,

I looked over the code and I think this will be fairly straight forward since 
the "fortranfile.py" is a stand alone module and your code is using that module 
to Write out Binary files.

Here is my suggested plan of attack:

1.  Move (or Copy for now) the fortranfile.py into ocw/data_source/utils  <== 
That last folder will need to be created.
2.  Move your two functions that leverage fortranfile.py into 
ocw/data_source/local.py  ("writeBN_lola", "writeBNdata").
3.  Add an import statement to local.py so when your functions call on 
fortranfile it is available.
4.  Over in mccsearch find all places in the code that call your two writeBN 
functions and have them import ocw.data_source.local and call the functions 
from their new home via local.writeBN_lola and local.writeBNdata.


Here is my rationale:

We will want to put the fortranfile.py module into the utils folder since we 
don't expect folks to call it directly the way local, dap, and rcmed are (since 
they are data_sources) but it is clearly a utility to the data_source package.
This will enhance the local module, which until now has been a read-only 
module, it will now be able to write Binary files out.  This does beg the 
question that if local.py will "write data" then is it a data_source anymore?  
Let's consider what the API would look like.

from ocw.data_source import local

local.writeBNdata(args*)

Not terrible, but I am not sure we want to write using a local data_source.  
That will take some considering, so.... Moving on....
You will be directly contributing your two Binary file writers to the ocw core, 
which is excellent.

I also spied writeNCfile() in your mccsearch/code/files.py which is another 
candidate to be migrated into data_source/local.py, but that is a topic for 
another JIRA.

Lewis and Kim please let me know if any of this sounds reasonable.

Cheers!


> Update mccsearch files.py to use current replacement of utils.fortran function
> ------------------------------------------------------------------------------
>
>                 Key: CLIMATE-536
>                 URL: https://issues.apache.org/jira/browse/CLIMATE-536
>             Project: Apache Open Climate Workbench
>          Issue Type: Task
>          Components: mcc search
>    Affects Versions: 0.5
>            Reporter: Lewis John McGibbney
>            Assignee: Kim Whitehall
>            Priority: Critical
>             Fix For: 0.5
>
>
> Currently files.py within the mccsearch module uses a legacy (incorrect) 
> fortranfile.py (0)... which hails from the now deprecated rcmet 
> fortranfile.py (1)
> We need to make a determination as to how this should be upgraded.
> In particular, we use the following functions
>  * [fortranfile.FortranFile(fileName, 
> mode='w')|https://github.com/apache/climate/blob/master/mccsearch/code/files.py#L529]
> (0) https://github.com/apache/climate/blob/master/mccsearch/code/files.py#L32
> (1) 
> https://github.com/apache/climate/blob/master/rcmet/src/main/python/rcmes/utils/fortranfile.py



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to