Skip to content

Commit

Permalink
Support for Windows
Browse files Browse the repository at this point in the history
* Improved windows support by adding environment_wds.yml file and removing unix-specific `resource` package

* Added .idea folder to gitignore

* Remove unnecessary comments

---------

Co-authored-by: Marco Heyden <heyden@i40pool.ipd.kit.edu>
  • Loading branch information
heymarco and Marco Heyden authored Jan 11, 2024
1 parent 3631229 commit 76f9c3d
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# PyCharm
.idea/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
152 changes: 152 additions & 0 deletions environment_wds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: MOABridge
channels:
- conda-forge
- https://conda.anaconda.org/conda-forge/
- defaults
dependencies:
- appnope=0.1.3=pyhd8ed1ab_0
- argon2-cffi-bindings=21.2.0=py39ha55989b_4
- bzip2=1.0.8=hcfcfb64_5
- ca-certificates=2023.11.17=h56e8100_0
- cffi=1.16.0=py39ha55989b_0
- exceptiongroup=1.2.0=pyhd8ed1ab_0
- idna=3.6=pyhd8ed1ab_0
- libcxx=7.0.0=h1ad3211_1002
- libffi=3.4.2=h8ffe710_5
- libsqlite=3.44.2=hcfcfb64_0
- libzlib=1.2.13=hcfcfb64_5
- llvm-meta=7.0.0=0
- openssl=3.2.0=hcfcfb64_1
- pip=23.3.2=pyhd8ed1ab_0
- pycparser=2.21=pyhd8ed1ab_0
- python=3.9.18=h4de0772_1_cpython
- python-dateutil=2.8.2=pyhd8ed1ab_0
- python_abi=3.9=4_cp39
- setuptools=69.0.3=pyhd8ed1ab_0
- six=1.16.0=pyh6c4a22f_0
- sniffio=1.3.0=pyhd8ed1ab_0
- sqlite=3.44.2=hcfcfb64_0
- tk=8.6.13=h5226925_1
- typing-extensions=4.9.0=hd8ed1ab_0
- typing_extensions=4.9.0=pyha770c72_0
- ucrt=10.0.22621.0=h57928b3_0
- vc=14.3=hcf57466_18
- vc14_runtime=14.38.33130=h82b7239_18
- vs2015_runtime=14.38.33130=hcb4865c_18
- wheel=0.42.0=pyhd8ed1ab_0
- xz=5.2.6=h8d14728_0
- zlib=1.2.13=hcfcfb64_5
- pip:
- anyio==4.2.0
- argon2-cffi==23.1.0
- arrow==1.3.0
- asttokens==2.4.1
- async-lru==2.0.4
- attrs==23.2.0
- babel==2.14.0
- backcall==0.2.0
- beautifulsoup4==4.12.2
- bleach==6.1.0
- certifi==2023.11.17
- charset-normalizer==3.3.2
- colorama==0.4.6
- comm==0.2.1
- contourpy==1.2.0
- cycler==0.12.1
- debugpy==1.8.0
- decorator==5.1.1
- defusedxml==0.7.1
- executing==2.0.1
- fastjsonschema==2.19.1
- filelock==3.13.1
- fonttools==4.47.0
- fqdn==1.5.1
- gdown==4.7.1
- importlib-metadata==7.0.1
- importlib-resources==6.1.1
- iniconfig==2.0.0
- ipykernel==6.28.0
- ipython==8.18.1
- ipywidgets==8.1.1
- isoduration==20.11.0
- jedi==0.19.1
- jinja2==3.1.2
- jpype1==1.5.0
- json5==0.9.14
- jsonpointer==2.4
- jsonschema==4.20.0
- jsonschema-specifications==2023.12.1
- jupyter==1.0.0
- jupyter-client==8.6.0
- jupyter-console==6.6.3
- jupyter-core==5.7.0
- jupyter-events==0.9.0
- jupyter-lsp==2.2.1
- jupyter-server==2.12.2
- jupyter-server-terminals==0.5.1
- jupyterlab==4.0.10
- jupyterlab-pygments==0.3.0
- jupyterlab-server==2.25.2
- jupyterlab-widgets==3.0.9
- kiwisolver==1.4.5
- markupsafe==2.1.3
- matplotlib==3.8.2
- matplotlib-inline==0.1.6
- mistune==3.0.2
- nbclient==0.9.0
- nbconvert==7.14.0
- nbformat==5.9.2
- nest-asyncio==1.5.8
- notebook==7.0.6
- notebook-shim==0.2.3
- numpy==1.26.3
- overrides==7.4.0
- packaging==23.2
- pandas==2.1.4
- pandocfilters==1.5.0
- parso==0.8.3
- pillow==10.2.0
- platformdirs==4.1.0
- pluggy==1.3.0
- prometheus-client==0.19.0
- prompt-toolkit==3.0.43
- psutil==5.9.7
- pure-eval==0.2.2
- pygments==2.17.2
- pyparsing==3.1.1
- pysocks==1.7.1
- python-json-logger==2.0.7
- pytz==2023.3.post1
- pywin32==306
- pywinpty==2.0.12
- pyyaml==6.0.1
- pyzmq==25.1.2
- qtconsole==5.5.1
- qtpy==2.4.1
- referencing==0.32.1
- requests==2.31.0
- rfc3339-validator==0.1.4
- rfc3986-validator==0.1.1
- river==0.21.0
- rpds-py==0.16.2
- scipy==1.11.4
- send2trash==1.8.2
- soupsieve==2.5
- stack-data==0.6.3
- terminado==0.18.0
- tinycss2==1.2.1
- tomli==2.0.1
- tornado==6.4
- tqdm==4.66.1
- traitlets==5.14.1
- types-python-dateutil==2.8.19.20240106
- tzdata==2023.4
- uri-template==1.3.0
- urllib3==2.1.0
- wcwidth==0.2.13
- webcolors==1.13
- webencodings==0.5.1
- websocket-client==1.7.0
- widgetsnbextension==4.0.9
- zipp==3.17.0
prefix: C:\Users\heyden\Miniconda3\envs\MOABridge
5 changes: 2 additions & 3 deletions evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import numpy as np
import time
import datetime as dt
import resource
import os
import random

Expand Down Expand Up @@ -284,14 +283,14 @@ def __init__(self, schema=None, window_size=1000):
## Functions to measure runtime
def start_time_measuring():
start_wallclock_time = time.time()
start_cpu_time = resource.getrusage(resource.RUSAGE_SELF).ru_utime + resource.getrusage(resource.RUSAGE_SELF).ru_stime
start_cpu_time = time.process_time()

return start_wallclock_time, start_cpu_time

def stop_time_measuring(start_wallclock_time, start_cpu_time):
# Stop measuring time
end_wallclock_time = time.time()
end_cpu_time = resource.getrusage(resource.RUSAGE_SELF).ru_utime + resource.getrusage(resource.RUSAGE_SELF).ru_stime
end_cpu_time = time.process_time()

# Calculate and print the elapsed time and CPU times
elapsed_wallclock_time = end_wallclock_time - start_wallclock_time
Expand Down

0 comments on commit 76f9c3d

Please sign in to comment.