Skip to content

Commit

Permalink
bump to python 3.11.4 (#27)
Browse files Browse the repository at this point in the history
* bump to python 3.11.4

* Update requirements.txt

* lint

* revert

---------

Co-authored-by: Maxime Desroches <[email protected]>
  • Loading branch information
adeebshihadeh and maxime-desroches authored Jun 27, 2023
1 parent 3319f4c commit 3689d81
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: check-merge-conflict
- id: check-symlinks
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
rev: v1.4.0
hooks:
- id: mypy
additional_dependencies: ['git+https://github.com/numpy/numpy-stubs']
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ RUN apt-get update && apt-get install -y capnproto libcapnp-dev clang wget git a

RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
RUN pyenv install 3.8.5
RUN pyenv global 3.8.5
RUN pyenv install 3.11.4
RUN pyenv global 3.11.4
RUN pyenv rehash

WORKDIR /project
Expand Down
2 changes: 1 addition & 1 deletion examples/kinematic_kf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
if __name__ == '__main__': # generating sympy code
from rednose.helpers.ekf_sym import gen_code
else:
from rednose.helpers.ekf_sym_pyx import EKF_sym_pyx
from rednose.helpers.ekf_sym_pyx import EKF_sym_pyx # pylint: disable=no-name-in-module


class ObservationKind():
Expand Down
2 changes: 1 addition & 1 deletion examples/test_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if __name__ == '__main__': # generating sympy code
from rednose.helpers.ekf_sym import gen_code
else:
from rednose.helpers.ekf_sym_pyx import EKF_sym_pyx
from rednose.helpers.ekf_sym_pyx import EKF_sym_pyx # pylint: disable=no-name-in-module
from rednose.helpers.ekf_sym import EKF_sym as EKF_sym2


Expand Down
Empty file added rednose/__init__.py
Empty file.
6 changes: 3 additions & 3 deletions rednose/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def write_code(folder, name, code, header):
if not os.path.exists(folder):
os.mkdir(folder)

open(os.path.join(folder, f"{name}.cpp"), 'w').write(code)
open(os.path.join(folder, f"{name}.h"), 'w').write(header)
open(os.path.join(folder, f"{name}.cpp"), 'w', encoding='utf-8').write(code)
open(os.path.join(folder, f"{name}.h"), 'w', encoding='utf-8').write(header)


def load_code(folder, name, lib_name=None):
Expand All @@ -20,7 +20,7 @@ def load_code(folder, name, lib_name=None):
shared_fn = os.path.join(folder, f"lib{lib_name}.{shared_ext}")
header_fn = os.path.join(folder, f"{name}.h")

with open(header_fn) as f:
with open(header_fn, encoding='utf-8') as f:
header = f.read()

# is the only thing that can be parsed by cffi
Expand Down
6 changes: 3 additions & 3 deletions rednose/helpers/ekf_sym.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ def gen_code(folder, name, f_sym, dt_sym, x_sym, obs_eqs, dim_x, dim_err, eskf_p

# merge code blocks
header += "}"
code = "\n".join([pre_code, code, open(os.path.join(TEMPLATE_DIR, "ekf_c.c")).read(), post_code])
code = "\n".join([pre_code, code, open(os.path.join(TEMPLATE_DIR, "ekf_c.c"), encoding='utf-8').read(), post_code])

# write to file
if not os.path.exists(folder):
os.mkdir(folder)

open(os.path.join(folder, f"{name}.h"), 'w').write(header) # header is used for ffi import
open(os.path.join(folder, f"{name}.cpp"), 'w').write(code)
open(os.path.join(folder, f"{name}.h"), 'w', encoding='utf-8').write(header) # header is used for ffi import
open(os.path.join(folder, f"{name}.cpp"), 'w', encoding='utf-8').write(code)


class EKF_sym():
Expand Down
2 changes: 1 addition & 1 deletion rednose/helpers/feature_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def generate_code(generated_dir, K=5):
c_code += "#include <string.h>\n"
c_code += "#define K %d\n" % K
c_code += "extern \"C\" {\n"
c_code += "\n" + open(os.path.join(TEMPLATE_DIR, "feature_handler.c")).read()
c_code += "\n" + open(os.path.join(TEMPLATE_DIR, "feature_handler.c"), encoding='utf-8').read()
c_code += "\n}\n"

filename = f"{FeatureHandler.name}_{K}"
Expand Down
2 changes: 1 addition & 1 deletion rednose/helpers/lst_sq_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def generate_code(generated_dir, K=4):
code += "\n#define KDIM %d\n" % K
code += "extern \"C\" {\n"
code += sympy_code
code += "\n" + open(os.path.join(TEMPLATE_DIR, "compute_pos.c")).read() + "\n"
code += "\n" + open(os.path.join(TEMPLATE_DIR, "compute_pos.c"), encoding='utf-8').read() + "\n"
code += "}\n"

header += "\nvoid compute_pos(double *to_c, double *in_poses, double *in_img_positions, double *param, double *pos);\n"
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ numpy
scipy
tqdm
cffi
scons==4.1.0.post1
pre-commit==2.10.1
pylint==2.7.1
Cython==0.29.22
scons
pre-commit
pylint
Cython

0 comments on commit 3689d81

Please sign in to comment.