Skip to content

Commit

Permalink
Change any CRLF to LF
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Gåsemyr Magnus authored and JensGM committed Mar 1, 2021
1 parent 4c4b0d1 commit 74573c4
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 115 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ commands:
- run:
name: Install Python dependencies
command: |
if [ `uname -s` == "Darwin" ]; then
if [ `uname -s` == "Darwin" ]; then
. py_venv/bin/activate
fi
python3 --version
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements-dev.txt
python3 -m pip install cmake flake8 bandit setuptools-scm
python3 -m pip install cmake flake8 bandit setuptools-scm
python3 -m pip install coverage codacy-coverage
python-build-test:
steps:
- run:
name: Build & test python
command: |
if [ `uname -s` == "Darwin" ]; then
if [ `uname -s` == "Darwin" ]; then
. py_venv/bin/activate
fi
python3 setup.py build_ext --inplace
Expand Down Expand Up @@ -87,7 +87,7 @@ commands:
- run:
name: Codacy code coverage check
command: |
if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then
if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then
coverage run setup.py test;
coverage xml;
python-codacy-coverage -r coverage.xml;
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
python-version: << parameters.python-version >>
- install-python-deps
- python-build-test

sdist-deploy:
docker:
- image: "circleci/python:3.6"
Expand Down Expand Up @@ -239,7 +239,7 @@ workflows:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/

macos-deploy:
jobs:
- wheels-macos-deploy:
Expand Down
40 changes: 20 additions & 20 deletions camille/output/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
"""\
Outputs
==========
This module is a collection of functions producing outputs.
Notes
-----
Used data formats might be too specific, so currently module is mainly
intended for internal use
Available functions
--------------------
* :func:`~camille.output.bazefetcher`
"""

from .bazefetcher import Bazefetcher

__all__ = [
'bazefetcher'
]
"""\
Outputs
==========
This module is a collection of functions producing outputs.
Notes
-----
Used data formats might be too specific, so currently module is mainly
intended for internal use
Available functions
--------------------
* :func:`~camille.output.bazefetcher`
"""

from .bazefetcher import Bazefetcher

__all__ = [
'bazefetcher'
]
54 changes: 27 additions & 27 deletions camille/source/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
"""\
Sources
==========
This module is a collection of functions reading inputs.
Notes
-----
Used data formats might be too specific, so currently module is mainly
intended for internal use
Available functions
-------------------
* :func:`~camille.source.bazefetcher`
* :func:`~camille.source.windiris`
"""


from .bazefetcher import Bazefetcher, TagNotFoundError
from .windiris import windiris
from .zephyre import Zephyre


__all__ = [
'Bazefetcher',
'windiris',
'Zephyre',
]
"""\
Sources
==========
This module is a collection of functions reading inputs.
Notes
-----
Used data formats might be too specific, so currently module is mainly
intended for internal use
Available functions
-------------------
* :func:`~camille.source.bazefetcher`
* :func:`~camille.source.windiris`
"""


from .bazefetcher import Bazefetcher, TagNotFoundError
from .windiris import windiris
from .zephyre import Zephyre


__all__ = [
'Bazefetcher',
'windiris',
'Zephyre',
]
124 changes: 62 additions & 62 deletions tests/test_data/synthetic_windiris_generator.py
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
#!/usr/bin/env python
"""
Simple program to create synthetic windiris data
"""

from datetime import datetime
from itertools import cycle
from pytz import utc
from noise import pnoise2
import os
import pandas as pd


def perlin(x, y, yoffset, xscale=0.01, yscale=0.133):
return pnoise2(x * xscale, y * yscale + yoffset)


def main():
root = 'windiris'
start_date = datetime(2030, 1, 1, tzinfo=utc)
end_date = datetime(2030, 1, 4, tzinfo=utc)

times = pd.date_range(start_date, end_date, freq='S', tz=utc).repeat(10)
distances = cycle(
[50.0, 80.0, 120.0, 160.0, 200.0, 240.0, 280.0, 320.0, 360.0, 400.0])
los_ids = cycle(pd.Series([0, 1, 2, 3]).repeat(10))
rowc = len(times)

tilt = pd.Series([perlin(x, 10, 0) for x in range(rowc // 10)]).repeat(10)
roll = pd.Series([perlin(x, 11, 0) for x in range(rowc // 10)]).repeat(10)
tilt = tilt + 1
roll = roll + 1

rws = pd.Series([perlin(x, y, 0) for x in range(rowc // 10) for y in range(10)])
rws = (rws + 1) * 5


df = pd.DataFrame({
'LOS index': [next(los_ids) for _ in range(rowc)],
'Distance': [next(distances) for _ in range(rowc)],
'RWS': rws.values,
'DRWS': 0,
'CNR': 0,
'Tilt': tilt.values,
'Roll': roll.values,
'RWS Status': 1,
'Overrun Status': 1,
}, index=times)

for d in df.groupby(df.index.date):
date = d[0]
dfd = d[1].copy()
dfd.insert(0, 'Timestamp',
dfd.index.map(lambda a: a.strftime('%Y-%m-%d %H:%M:%S.%f')))

fname = os.path.join(root, date.strftime('WI_%Y-%m-%d.csv'))
os.makedirs(root, exist_ok=True)
dfd.to_csv(fname, index=False, sep=';')


if __name__ == '__main__':
main()
#!/usr/bin/env python
"""
Simple program to create synthetic windiris data
"""

from datetime import datetime
from itertools import cycle
from pytz import utc
from noise import pnoise2
import os
import pandas as pd


def perlin(x, y, yoffset, xscale=0.01, yscale=0.133):
return pnoise2(x * xscale, y * yscale + yoffset)


def main():
root = 'windiris'
start_date = datetime(2030, 1, 1, tzinfo=utc)
end_date = datetime(2030, 1, 4, tzinfo=utc)

times = pd.date_range(start_date, end_date, freq='S', tz=utc).repeat(10)
distances = cycle(
[50.0, 80.0, 120.0, 160.0, 200.0, 240.0, 280.0, 320.0, 360.0, 400.0])
los_ids = cycle(pd.Series([0, 1, 2, 3]).repeat(10))
rowc = len(times)

tilt = pd.Series([perlin(x, 10, 0) for x in range(rowc // 10)]).repeat(10)
roll = pd.Series([perlin(x, 11, 0) for x in range(rowc // 10)]).repeat(10)
tilt = tilt + 1
roll = roll + 1

rws = pd.Series([perlin(x, y, 0) for x in range(rowc // 10) for y in range(10)])
rws = (rws + 1) * 5


df = pd.DataFrame({
'LOS index': [next(los_ids) for _ in range(rowc)],
'Distance': [next(distances) for _ in range(rowc)],
'RWS': rws.values,
'DRWS': 0,
'CNR': 0,
'Tilt': tilt.values,
'Roll': roll.values,
'RWS Status': 1,
'Overrun Status': 1,
}, index=times)

for d in df.groupby(df.index.date):
date = d[0]
dfd = d[1].copy()
dfd.insert(0, 'Timestamp',
dfd.index.map(lambda a: a.strftime('%Y-%m-%d %H:%M:%S.%f')))

fname = os.path.join(root, date.strftime('WI_%Y-%m-%d.csv'))
os.makedirs(root, exist_ok=True)
dfd.to_csv(fname, index=False, sep=';')


if __name__ == '__main__':
main()

0 comments on commit 74573c4

Please sign in to comment.