Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBEC 2021
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Léna Aix
EBEC 2021
Merge requests
!1
Sansdocker
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Open
Sansdocker
sansdocker
into
master
Overview
0
Commits
8
Pipelines
0
Changes
1
Open
Sansdocker
Alexandre Pradeilles
requested to merge
sansdocker
into
master
Apr 15, 2021
Overview
0
Commits
8
Pipelines
0
Changes
1
0
0
Merge request reports
Viewing commit
2c67e991
Prev
Next
Show latest version
1 file
+
1
−
22
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
2c67e991
read me
· 2c67e991
Alexandre Pradeilles
authored
Apr 15, 2021
research.py
+
1
−
22
View file @ 2c67e991
Edit in single-file editor
Open in Web IDE
Show full file
from
request
import
requete_osm
from
math
import
sqrt
,
sin
,
cos
,
pi
from
concurrent.futures
import
ThreadPoolExecutor
import
time
def
circular_research
(
lat
,
lon
,
main_street
):
@@ -90,29 +89,11 @@ def check_position(lat, lon, step, main_street, i):
return
street
def
multi_position
(
lat
,
lon
,
step
):
#test de multrithreading mais cela n'améliore pas énormément la vitesse de calcul
#donc pas utilisé finalement
latitude
=
[]
longitude
=
[]
for
j
in
range
(
1
,
4
):
stp
=
j
*
step
for
i
in
range
(
8
):
latitude
.
append
(
lat
+
stp
*
cos
(
i
*
2
*
pi
/
8
))
longitude
.
append
(
lon
+
stp
*
sin
(
i
*
2
*
pi
/
8
))
with
ThreadPoolExecutor
(
max_workers
=
30
)
as
executor
:
streets
=
executor
.
map
(
requete_osm
,
latitude
,
longitude
)
executor
.
shutdown
(
wait
=
True
)
return
streets
if
__name__
==
"
__main__
"
:
lat
=
48.89494122
lon
=
2.247959188
step
=
10
**
(
-
5
)
main_street
=
'
Avenue Gambetta
'
t1
=
time
.
time
()
streets
=
multi_position
(
48.89494122
,
2.247959188
,
10
**
(
-
5
))
t2
=
time
.
time
()
#print(len(list(streets)))
print
(
t2
-
t1
)
t1
=
time
.
time
()
@@ -121,6 +102,4 @@ if __name__=="__main__":
for
i
in
range
(
8
):
check_position
(
lat
,
lon
,
stp
,
main_street
,
i
)
t2
=
time
.
time
()
print
(
t2
-
t1
)
print
(
t2
-
t1
)
\ No newline at end of file
Loading