Skip to content

Loop mi v5 pilot#931

Open
sujit22993 wants to merge 16 commits intomasterfrom
loop_mi_v5_pilot
Open

Loop mi v5 pilot#931
sujit22993 wants to merge 16 commits intomasterfrom
loop_mi_v5_pilot

Conversation

@sujit22993
Copy link
Copy Markdown
Contributor

@sujit22993 sujit22993 commented Jun 7, 2018

Market Information in Loop App.
Release Steps :
Test

  • change directory to desired instance code base
  • git fetch origin
  • git checkout loop_mi_v5_pilot
  • sudo apache2ctl graceful

Prod

  • change directory to desired instance code base
  • git fetch origin
  • git merge origin/master --ff-only --no-commit
  • sudo apache2ctl graceful

@sujit22993 sujit22993 requested a review from Abhishek-lodha June 7, 2018 07:27
Comment thread loop/mi_views.py Outdated

from mi_data_structure import *
from loop.models import *
import pandas as pd
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please organise the imports appropriately

Comment thread loop/mi_views.py Outdated
gaddidar_data_obj = Gaddidar.objects.filter(mandi__id__in=mandi_list)

# Read CSV file and filter for requested Aggreagator
filepath = os.path.join(fileDir, "/home/trionfo/Documents/dg/loop/utils/Transport Cost & Capacity Data - Sheet1.csv")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove hard coded file path & print statement

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread loop_ivr/utils/marketinfo/get_query.py Outdated
def query_for_rates(crop_list, mandi_list, date_range=3):
# today_date = datetime(2018, 03, 21)
today_date = datetime.now()
today_date = datetime(2018, 05, 22)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be changed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOne

Comment thread loop/urls.py Outdated
url(r'^get_partners_list/', get_partners_list),
url(r'^admin/logout/?$', 'django.contrib.auth.views.logout', {'next_page': '/loop/admin/'}),
url(r'^admin/', include(loop_admin.urls)),
url(r'^get_agg_mi_data', get_aggregator_mi_related_data),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

append slash after the urls

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Comment thread loop/mi_views.py Outdated
return agg_list_requested


# def getJSONObj(**kwargs):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, done

Comment thread loop/mi_views.py


def is_authenticated(request):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add function doc string to explain the working of function

Comment thread loop/mi_views.py
cropobj = Crop.objects.values_list('id', flat=True)
cropobj = map(int, cropobj)
# Prepare data
crop_list = tuple(cropobj)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if only 1 crop is requested, will this tuple method work?

Comment thread loop/mi_views.py
latest_price_date = pd.Timestamp('2015-01-01')
cropmandidata = CropMandiData(crop_id=i[0], mandi_id= i[1])
for index, row in r.iterrows():
crop, mandi, date, Av_Rate, STD, PriceMax, PriceMin = row['Crop'], row['Market_Real'], row['Date'], row['Av_Ratemean'], row['STDmean'], row['Pricemax'], row['Pricemin']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that avg_price and std are always returned from the function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You doubt that? :<, BTW yes.

Comment thread loop/mi_views.py
mandi_res = []
for mandiobj in mandi_data_obj:
mandiobjdetail = MandiDetail(mandi_id=mandiobj['id'], mandi_name=mandiobj[mandi_name_label], mandi_category='Chhoti Mandi',\
mandi_distance='590')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are category and distance hardcoded?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Initially, testing.

Comment thread loop/mi_data_structure.py
self.cost = kwargs['transport_cost']
self.capacity = kwargs['transport_capacity']

def getTransportDetail(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why these methods?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK

@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
@digitalgreenorg digitalgreenorg deleted a comment Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants