Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: antoine-peartree/TGVmax_mapper
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Jojain/TGVmax_mapper
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 5 commits
  • 1 file changed
  • 2 contributors

Commits on Feb 17, 2020

  1. file not closed bug fix

    Jojain committed Feb 17, 2020
    Copy the full SHA
    e098fcb View commit details
  2. Resources file must not be commited

    I just added it into the gitignore
    antoine-peartree authored Feb 17, 2020
    Copy the full SHA
    b5e019c View commit details
  3. Resources file must not be commited

    Just added into the gitignore too
    antoine-peartree authored Feb 17, 2020
    Copy the full SHA
    46a9c48 View commit details
  4. Resources file must not be commited

    Just added into the gitignore
    antoine-peartree authored Feb 17, 2020
    Copy the full SHA
    621f0f6 View commit details
  5. Resources file must not be commited

    Just added into the gitignore
    antoine-peartree authored Feb 17, 2020
    Copy the full SHA
    465d79b View commit details
Showing with 15 additions and 15 deletions.
  1. +15 −15 tgvmax_mapper/user_interface.py
30 changes: 15 additions & 15 deletions tgvmax_mapper/user_interface.py
Original file line number Diff line number Diff line change
@@ -104,22 +104,22 @@ def __init__(self):
self.progress_label = Label(self.root)

def download_data(self, url, chunk_size, csv_path, cols_useless):
"""Download TGVmax possiblities from SNCF open database."""
"""Download TGVmax possiblities from SNCF open database"""
response = requests.get(url, stream=True)
handle = open(csv_path, "wb")
nb_chunks_dl = 0
for chunk in response.iter_content(chunk_size=chunk_size):
if chunk: # filter out keep-alive new chunks
handle.write(chunk)
nb_chunks_dl += 1
percent = round(nb_chunks_dl*100/88)
print("Wait... "+str(percent)+"%")
self.progress["value"] = percent
self.progress_label.config(text=str(percent) + " %")
self.progress.pack(padx=10, pady=10)
self.progress_label.pack(padx=10)
self.root.update()

with open(csv_path, "wb") as handle:
nb_chunks_dl = 0
for chunk in response.iter_content(chunk_size=chunk_size):
if chunk: # filter out keep-alive new chunks
handle.write(chunk)
nb_chunks_dl += 1
percent = round(nb_chunks_dl*100/88)
print("Wait... "+str(percent)+"%")
self.progress["value"] = percent
self.progress_label.config(text=str(percent) + " %")
self.progress.pack(padx=10, pady=10)
self.progress_label.pack(padx=10)
self.root.update()
data = pd.read_csv(csv_path, sep=';')
data = data[data[DISPO_TGVMAX] == 'OUI']
for col in cols_useless: