Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)

To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
This commit is contained in:
Konstantin Pastbin
2025-04-13 16:37:30 +07:00
commit e3e4a1985a
12931 changed files with 13195100 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
from src.logger import LOG
def create_string_array(values):
return f"[{','.join(str(x) for x in values)}]"
def create_distribution_script(*, values, title, save_path):
values_string = create_string_array(values)
output = f'''
import numpy as np
import matplotlib.pyplot as plt
a = np.hstack({values_string})
plt.hist(a, bins='auto') # arguments are passed to np.histogram
plt.title("{title}")
plt.show()'''
fh = open(save_path, 'w')
fh.write(output)
fh.close()
LOG.info(f'Run: {save_path}, to look at {title} distribution.')
def create_plots(*, plots, xlabel, ylabel, save_path):
legends = "["
xlist = "["
ylist = "["
for plot in plots:
legends += "'" + plot['legend'] + "'" + ','
xlist += create_string_array(plot['points_x']) + ','
ylist += create_string_array(plot['points_y']) + ','
legends += ']'
xlist += ']'
ylist += ']'
output = f'''
import pylab
legends = {legends}
xlist = {xlist}
ylist = {ylist}
for (x, y, l) in zip(xlist, ylist, legends):
pylab.plot(x, y, label=l)
pylab.axhline(0, color='red', marker='o', linestyle='dashed')
pylab.xlabel("{xlabel}")
pylab.ylabel("{ylabel}")
pylab.legend()
pylab.tight_layout()
pylab.show()
'''
fh = open(save_path, 'w')
fh.write(output)
fh.close()
LOG.info(f'Run: {save_path}, to look at {xlabel} x {ylabel} plot.')