[ 
https://issues.apache.org/jira/browse/CLIMATE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cameron Goodale updated CLIMATE-261:
------------------------------------

    Description: 
Currently there are two copies of the same functionality within the rcmes 
module.  These two functions are almost line for line the same code.

rcmes.toolkit.process.decodeTimeFromString(time_string)
vs.
rcmes.services.decode_model_times.decodeTimeFromString(time_string)

Since this seems like useful functionality we should pull it into the ocw 
package once the Refactoring Branch has been merged into the trunk.

When the final implementation of this feature is written, these two functions 
will need to updated to call the canonical implementation at the least.

The best approach would be to find and replace all places in the code that 
these functions are called, and update those places to call the new 
implementation.

The code also needs to raise an exception if it is unable to parse the input 
string instead of just returning 0.

Task Plan:
=============
1. Develop a Canonical function within ocw to handle parsing a string into a 
Python Datetime object
2. Ensure the new function is unit tested and Raises an error when unable to 
Parse the string.  ValueError?
3. Update the two functions listed in this issue so they use the new function 
within ocw
4. Add deprecation docstrings to the functions


  was:
Currently there are two copies of the same functionality within the rcmes 
module.  These two functions are almost line for line the same code.

rcmes.toolkit.process.decodeTimeFromString(time_string)
vs.
rcmes.services.decode_model_times.decodeTimeFromString(time_string)

Since this seems like useful functionality we should pull it into the ocw 
package once the Refactoring Branch has been merged into the trunk.

When the final implementation of this feature is written, these two functions 
will need to updated to call the canonical implementation at the least.

The best approach would be to find and replace all places in the code that 
these functions are called, and update those places to call the new 
implementation.

    
> Consolidate Code that converts a String into a Datetime Object
> --------------------------------------------------------------
>
>                 Key: CLIMATE-261
>                 URL: https://issues.apache.org/jira/browse/CLIMATE-261
>             Project: Apache Open Climate Workbench
>          Issue Type: Improvement
>          Components: rcmet
>    Affects Versions: 0.2-incubating
>         Environment: *nix
>            Reporter: Cameron Goodale
>            Assignee: Cameron Goodale
>            Priority: Minor
>
> Currently there are two copies of the same functionality within the rcmes 
> module.  These two functions are almost line for line the same code.
> rcmes.toolkit.process.decodeTimeFromString(time_string)
> vs.
> rcmes.services.decode_model_times.decodeTimeFromString(time_string)
> Since this seems like useful functionality we should pull it into the ocw 
> package once the Refactoring Branch has been merged into the trunk.
> When the final implementation of this feature is written, these two functions 
> will need to updated to call the canonical implementation at the least.
> The best approach would be to find and replace all places in the code that 
> these functions are called, and update those places to call the new 
> implementation.
> The code also needs to raise an exception if it is unable to parse the input 
> string instead of just returning 0.
> Task Plan:
> =============
> 1. Develop a Canonical function within ocw to handle parsing a string into a 
> Python Datetime object
> 2. Ensure the new function is unit tested and Raises an error when unable to 
> Parse the string.  ValueError?
> 3. Update the two functions listed in this issue so they use the new function 
> within ocw
> 4. Add deprecation docstrings to the functions

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to