Merge branch 'master' of gitfub.space:Pownie/BerGeo
This commit is contained in:
commit
558cc3e4bf
244
.gitignore
vendored
Normal file
244
.gitignore
vendored
Normal file
|
@ -0,0 +1,244 @@
|
||||||
|
|
||||||
|
# Created by https://www.gitignore.io/api/python,pycharm,pycharm+all,pycharm+iml
|
||||||
|
|
||||||
|
### PyCharm ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff:
|
||||||
|
.idea/**/workspace.xml
|
||||||
|
.idea/**/tasks.xml
|
||||||
|
.idea/dictionaries
|
||||||
|
|
||||||
|
# Sensitive or high-churn files:
|
||||||
|
.idea/**/dataSources/
|
||||||
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.xml
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
|
||||||
|
# Gradle:
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-debug/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin:
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
## File-based project format:
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
## Plugin-specific files:
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# Ruby plugin and RubyMine
|
||||||
|
/.rakeTasks
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
### PyCharm Patch ###
|
||||||
|
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||||
|
|
||||||
|
# *.iml
|
||||||
|
# modules.xml
|
||||||
|
# .idea/misc.xml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# Sonarlint plugin
|
||||||
|
.idea/sonarlint
|
||||||
|
|
||||||
|
### PyCharm+all ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff:
|
||||||
|
|
||||||
|
# Sensitive or high-churn files:
|
||||||
|
|
||||||
|
# Gradle:
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
|
||||||
|
# Mongo Explorer plugin:
|
||||||
|
|
||||||
|
## File-based project format:
|
||||||
|
|
||||||
|
## Plugin-specific files:
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
|
||||||
|
# Ruby plugin and RubyMine
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
|
||||||
|
### PyCharm+all Patch ###
|
||||||
|
# Ignores the whole idea folder
|
||||||
|
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
### PyCharm+iml ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff:
|
||||||
|
|
||||||
|
# Sensitive or high-churn files:
|
||||||
|
|
||||||
|
# Gradle:
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
|
||||||
|
# Mongo Explorer plugin:
|
||||||
|
|
||||||
|
## File-based project format:
|
||||||
|
|
||||||
|
## Plugin-specific files:
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
|
||||||
|
# Ruby plugin and RubyMine
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
|
||||||
|
### PyCharm+iml Patch ###
|
||||||
|
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
|
||||||
|
|
||||||
|
*.iml
|
||||||
|
modules.xml
|
||||||
|
.idea/misc.xml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Python ###
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
.pytest_cache/
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
.hypothesis/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# celery beat schedule file
|
||||||
|
celerybeat-schedule.*
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
|
||||||
|
|
||||||
|
# End of https://www.gitignore.io/api/python,pycharm,pycharm+all,pycharm+iml
|
|
@ -375,5 +375,4 @@ size: 536870912, step: 8388608 and time Elapsed: 70 milliseconds
|
||||||
size: 536870912, step: 16777216 and time Elapsed: 48 milliseconds
|
size: 536870912, step: 16777216 and time Elapsed: 48 milliseconds
|
||||||
size: 536870912, step: 33554432 and time Elapsed: 93 milliseconds
|
size: 536870912, step: 33554432 and time Elapsed: 93 milliseconds
|
||||||
size: 536870912, step: 67108864 and time Elapsed: 71 milliseconds
|
size: 536870912, step: 67108864 and time Elapsed: 71 milliseconds
|
||||||
size: 536870912, step: 134217728 and time Elapsed: 78 milliseconds
|
size: 536870912, step: 134217728 and time Elapsed: 78 milliseconds
|
||||||
|
|
BIN
heatmap.pdf
Normal file
BIN
heatmap.pdf
Normal file
Binary file not shown.
160
plotter.py
160
plotter.py
|
@ -1,76 +1,84 @@
|
||||||
import subprocess
|
import math
|
||||||
import tempfile
|
import subprocess
|
||||||
import re
|
import tempfile
|
||||||
import matplotlib.pyplot as plt
|
import re
|
||||||
from collections import defaultdict
|
import matplotlib.pyplot as plt
|
||||||
import argparse
|
from collections import defaultdict
|
||||||
from math import log2
|
import argparse
|
||||||
import pandas as pd
|
from math import log2
|
||||||
|
import pandas as pd
|
||||||
|
import seaborn as sns
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Read data from a data file and plot this.')
|
|
||||||
|
parser = argparse.ArgumentParser(description='Read data from a data file and plot this.')
|
||||||
parser.add_argument('--data_file', action='store', dest='data_file', default='plot_data.txt',
|
|
||||||
help='The desired data to be plotted.')
|
parser.add_argument('--data_file', action='store', dest='data_file', default='plot_data.txt',
|
||||||
parser.add_argument('--static_n', action='store_true',
|
help='The desired data to be plotted.')
|
||||||
help="Is the n variable static in the data file?")
|
parser.add_argument('--static_n', action='store_true',
|
||||||
parser.add_argument('--static_step', action='store_true',
|
help="Is the n variable static in the data file?")
|
||||||
help="Is the step variable static in the data file?")
|
parser.add_argument('--static_step', action='store_true',
|
||||||
|
help="Is the step variable static in the data file?")
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
args = parser.parse_args()
|
||||||
data = open(args.data_file).read()
|
|
||||||
|
data = open(args.data_file).read()
|
||||||
|
|
||||||
# d = {'static variable' : {step : time, step : time}}
|
|
||||||
|
# d = {'static variable' : {step : time, step : time}}
|
||||||
|
|
||||||
def prep_data(static_var, data):
|
|
||||||
non_static_var = (static_var + 1) % 2 # if 0 then 1, if 1 then 0
|
def prep_data(static_var, data):
|
||||||
#non_static_var = 1 - static_var #rip :(
|
non_static_var = (static_var + 1) % 2 # if 0 then 1, if 1 then 0
|
||||||
|
#non_static_var = 1 - static_var #rip :(
|
||||||
lines = data.split('\n')
|
|
||||||
static_vars = set()
|
lines = data.split('\n')
|
||||||
|
static_vars = set()
|
||||||
data = defaultdict(dict)
|
|
||||||
|
data = defaultdict(dict)
|
||||||
for line in lines[0:-1]:
|
|
||||||
all_vars = re.findall(r"\d+", line)
|
for line in lines[0:-1]:
|
||||||
|
all_vars = re.findall(r"\d+", line)
|
||||||
static = int(all_vars[static_var])
|
|
||||||
non_static = int(all_vars[non_static_var])
|
static = int(all_vars[static_var])
|
||||||
time = int(all_vars[2])
|
non_static = int(all_vars[non_static_var])
|
||||||
|
time = int(all_vars[2])
|
||||||
static_vars.add(static)
|
|
||||||
data[static][non_static] = time
|
static_vars.add(static)
|
||||||
|
data[static][non_static] = time
|
||||||
return data
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static_var = 0 if args.static_n else 1
|
|
||||||
plot_data = prep_data(static_var, data)
|
static_var = 0 if args.static_n else 1
|
||||||
df = pd.DataFrame(data=plot_data)
|
plot_data = prep_data(static_var, data)
|
||||||
print(df)
|
df = pd.DataFrame(data=plot_data)
|
||||||
|
print(df)
|
||||||
plt.imshow(df, cmap='hot')
|
|
||||||
plt.show()
|
hm = sns.heatmap(df, annot=False, square=False, cmap=sns.cm.rocket_r)
|
||||||
|
hm.invert_yaxis()
|
||||||
|
|
||||||
#first = plot_data[list(plot_data.keys())[2]]
|
# fix xtics
|
||||||
|
locs, labels = plt.xticks()
|
||||||
#plt.plot(first[0], first[1])
|
plt.xticks(locs, [f"$2^{{{int(math.log2(int(i.get_text())))}}}$" for i in labels])
|
||||||
|
locs, labels = plt.yticks()
|
||||||
#for static, plotting_data in plot_data.items():
|
plt.yticks(locs, [f"$2^{{{int(math.log2(int(i.get_text())))}}}$" for i in labels])
|
||||||
# x_axis = [log2(x) for x in plotting_data[0]]
|
|
||||||
# plt.plot(x_axis, plotting_data[1], marker="o", label = static)
|
plt.show()
|
||||||
|
|
||||||
|
#first = plot_data[list(plot_data.keys())[2]]
|
||||||
#plt.xticks([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26], ["$log2(2^2)$", "log2(2^4)", "log2(2^6)", "log2(2^8)", "log2(2^10)", "log2(2^12)", "log2(2^14)", "log2(2^16)", "log2(2^18)", "log2(2^20)", "log2(2^22)", "log2(2^24)", "log2(2^26)"])
|
|
||||||
#plt.legend(loc=1, borderaxespad=0.)
|
#plt.plot(first[0], first[1])
|
||||||
#plt.ylabel('time/ms')
|
|
||||||
#plt.xlabel('log(step)')
|
#for static, plotting_data in plot_data.items():
|
||||||
#plt.show()
|
# x_axis = [log2(x) for x in plotting_data[0]]
|
||||||
|
# plt.plot(x_axis, plotting_data[1], marker="o", label = static)
|
||||||
|
|
||||||
|
|
||||||
|
#plt.xticks([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26], ["$log2(2^2)$", "log2(2^4)", "log2(2^6)", "log2(2^8)", "log2(2^10)", "log2(2^12)", "log2(2^14)", "log2(2^16)", "log2(2^18)", "log2(2^20)", "log2(2^22)", "log2(2^24)", "log2(2^26)"])
|
||||||
|
#plt.legend(loc=1, borderaxespad=0.)
|
||||||
|
#plt.ylabel('time/ms')
|
||||||
|
#plt.xlabel('log(step)')
|
||||||
|
#plt.show()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user