You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@climate.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/04/29 07:34:12 UTC
[jira] [Commented] (CLIMATE-785) RCMED.py: Optimize code
[ https://issues.apache.org/jira/browse/CLIMATE-785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15263567#comment-15263567 ]
ASF GitHub Bot commented on CLIMATE-785:
----------------------------------------
GitHub user jarifibrahim opened a pull request:
https://github.com/apache/climate/pull/334
CLIMATE-785 - RCMED.py: optimize code
Fixes https://issues.apache.org/jira/browse/CLIMATE-785
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jarifibrahim/climate CLIMATE-785
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/climate/pull/334.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #334
----
commit 1903b90a089f31ae531d36ecedf8ab09805cc14a
Author: Ibrahim <ja...@gmail.com>
Date: 2016-04-29T05:31:55Z
CLIMATE-785 - RCMED.py: optimize code
Fixes https://issues.apache.org/jira/browse/CLIMATE-785
----
> RCMED.py: Optimize code
> -----------------------
>
> Key: CLIMATE-785
> URL: https://issues.apache.org/jira/browse/CLIMATE-785
> Project: Apache Open Climate Workbench
> Issue Type: Improvement
> Components: data sources
> Reporter: Ibrahim Jarif
> Assignee: Maziyar Boustani
> Priority: Trivial
> Labels: easyfix
>
> In ocw/data_source/rcmed.py file
> {code}
> if time_step.lower() == 'monthly':
> if time.day != 1:
> start_time_string = time.strftime('%Y%m%d')
> start_time_string = start_time_string[:6] + '01'
> time = datetime.strptime(start_time_string, '%Y%m%d')
> ##TODO: Change the 3 lines above with this line:
> ##time = datetime(time.year, time.month, 1)
> elif time_step.lower() == 'daily':
> if time.hour != 0 or time.minute != 0 or time.second != 0:
> start_time_string = time.strftime('%Y%m%d%H%M%S')
> start_time_string = start_time_string[:8] + '000000'
> time = datetime.strptime(start_time_string, '%Y%m%d%H%M%S')
> ##TODO: Change the 3 lines above with this line:
> ##time = datetime(time.year, time.month, time.day, 00, 00, 00)
> {code}
> The commented code can be used in place of the actual code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)