Skip to content

Commit 0240c80

Browse files
Merge pull request #75 from Stanford-NavLab/derwin/release-0.1.6
Derwin/release 0.1.6
2 parents 8812a3b + 489a413 commit 0240c80

11 files changed

Lines changed: 133 additions & 19 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**System Information (please complete the following information):**
27+
- OS: [e.g. Ubuntu]
28+
- OS Version: [e.g. 20.04]
29+
- Python Version: [e.g. 3.9.10]
30+
31+
**Additional context**
32+
Add any other context about the problem here.

.github/workflows/pip-install.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: pip-install-test
1+
name: pip-install
22

33
on:
44
pull_request:
55
branches: [ main ]
66
workflow_dispatch:
7-
7+
88

99
jobs:
1010
build:
@@ -31,7 +31,7 @@ jobs:
3131
# - name: Load cached poetry environment
3232
# id: cached-poetry-dependencies
3333
# uses: actions/cache@v2
34-
# with:
34+
# with:
3535
# path: .venv
3636
# key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
3737
# - name: Install dependencies

.github/workflows/pylint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: lint
1+
name: pylint
22

3-
on:
3+
on:
44
pull_request:
55
branches: [ main ]
66
workflow_dispatch:
@@ -27,7 +27,7 @@ jobs:
2727
- name: Load cached poetry environment
2828
id: cached-poetry-dependencies
2929
uses: actions/cache@v2
30-
with:
30+
with:
3131
path: .venv
3232
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
3333
- name: Install dependencies

.github/workflows/pypi-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# workflow copied from combination of
2+
# 1) https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
3+
# 2) https://www.caktusgroup.com/blog/2021/02/11/automating-pypi-releases/
4+
5+
name: pypi-release
6+
7+
on:
8+
release:
9+
types: [created]
10+
11+
jobs:
12+
deploy:
13+
name: Build and publish Python distribution to PyPI
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@master
18+
- name: Set up Python 3.10
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.10"
22+
23+
- name: Install pypa/build
24+
run: >-
25+
python -m
26+
pip install
27+
build
28+
--user
29+
- name: Build a binary wheel and a source tarball
30+
run: >-
31+
python -m
32+
build
33+
--sdist
34+
--wheel
35+
--outdir dist/
36+
.
37+
- name: Publish distribution to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1
39+
with:
40+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: build
4+
name: python-app
55

66
on:
77
push:

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ In the directory organization above:
8484

8585
Installation
8686
------------
87-
For directions on how to install the `gnss_lib_py` project, please
87+
88+
`gnss_lib_py` is available through `pip` installation with:
89+
90+
```
91+
pip install gnss-lib-py
92+
```
93+
94+
For directions on how to install an editable or developer installation of `gnss_lib_py` on Linux, MacOS, and Windows, please
8895
see the [install instructions](https://gnss-lib-py.readthedocs.io/en/latest/install.html).
8996

9097
Tutorials

docs/source/index.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ We provide standard row names for :code:`NavData` elements on the
3333
These names ensure cross compatability between different datasets and
3434
algorithms.
3535

36+
Source Code
37+
-----------
38+
All source code is available on GitHub at
39+
`github.com/stanford-navlab/gnss_lib_py <https://github.com/stanford-navlab/gnss_lib_py>`__.
40+
41+
3642
.. _organization:
3743

3844
Code Organization
@@ -87,7 +93,15 @@ In the directory organization above:
8793

8894
Installation
8995
------------
90-
For directions on how to install the :code:`gnss_lib_py` project, please
96+
97+
``gnss_lib_py`` is available through ``pip`` installation with:
98+
99+
.. code-block:: bash
100+
101+
pip install gnss-lib-py
102+
103+
For directions on how to install an editable or developer installation
104+
of ``gnss_lib_py`` on Linux, MacOS, and Windows, please
91105
see the :ref:`install instructions<install>`.
92106

93107
Tutorials

gnss_lib_py/utils/file_operations.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,22 @@ def get_timestamp():
3737
"""
3838
timestamp = time.strftime("%Y%m%d%H%M%S")
3939
return timestamp
40+
41+
def print_directory_levels():
42+
"""Prints out file directory levels.
43+
44+
"""
45+
46+
printed_path = os.path.realpath(__file__)
47+
48+
for level in range(5):
49+
print(f"{level} level(s) up: {printed_path}")
50+
printed_path = os.path.dirname(printed_path)
51+
52+
def print_cwd():
53+
"""Prints out file directory levels.
54+
55+
"""
56+
57+
print("cwd:",os.getcwd())
58+
print("dir above cwd:",os.path.dirname(os.getcwd()))

gnss_lib_py/utils/visualizations.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -670,11 +670,7 @@ def _save_figure(figures, titles=None, prefix="", fnames=None): # pragma: no cov
670670
if (len(fnames) == 1 and fnames[0] is None) \
671671
or fnames[fig_idx] is None:
672672
# create results folder if it does not yet exist.
673-
root_path = os.path.dirname(
674-
os.path.dirname(
675-
os.path.dirname(
676-
os.path.realpath(__file__))))
677-
log_path = os.path.join(root_path,"results",TIMESTAMP)
673+
log_path = os.path.join(os.getcwd(),"results",TIMESTAMP)
678674
fo.make_dir(log_path)
679675

680676
# make name path friendly
@@ -856,11 +852,7 @@ def _save_plotly(figures, titles=None, prefix="", fnames=None,
856852
if (len(fnames) == 1 and fnames[0] is None) \
857853
or fnames[fig_idx] is None:
858854
# create results folder if it does not yet exist.
859-
root_path = os.path.dirname(
860-
os.path.dirname(
861-
os.path.dirname(
862-
os.path.realpath(__file__))))
863-
log_path = os.path.join(root_path,"results",TIMESTAMP)
855+
log_path = os.path.join(os.getcwd(),"results",TIMESTAMP)
864856
fo.make_dir(log_path)
865857

866858
# make name path friendly

pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
filterwarnings =
3+
ignore:distutils:DeprecationWarning

0 commit comments

Comments
 (0)