Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor enhancements and a couple of handy utils #177

Merged
merged 2 commits into from
Jan 28, 2024

Conversation

jonnymaserati
Copy link
Owner

Some minor changes to Connector and the addition of a couple of utils. Re-wrote the tests to use pytest after getting vscode integration working. Fixed a deprecation warning in Survey.

…arts ==============================

platform linux2 -- Python 2.7.18, pytest-4.6.9, py-1.8.1, pluggy-0.13.0
rootdir: /home/jonathancorcutt/Dropbox/GitHub/welleng
collected 0 items / 21 errors

==================================== ERRORS ====================================
_______________ ERROR collecting tests/test_clearance_iscwsa.py ________________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/tests/test_clearance_iscwsa.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_clearance_iscwsa.py:1: in <module>
    from welleng.survey import Survey, make_survey_header
E   ImportError: No module named welleng.survey
___________________ ERROR collecting tests/test_connector.py ___________________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/tests/test_connector.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_connector.py:1: in <module>
    import numpy as np
E   ImportError: No module named numpy
_____________________ ERROR collecting tests/test_fluid.py _____________________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/tests/test_fluid.py", line 22
E       depth=10_000.,
E                  ^
E   SyntaxError: invalid syntax
_______________ ERROR collecting tests/test_iscwsa_mwd_error.py ________________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/tests/test_iscwsa_mwd_error.py", line 114
E       f"failing error {d}"
E                          ^
E   SyntaxError: invalid syntax
____________________ ERROR collecting tests/test_minimal.py ____________________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/tests/test_minimal.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_minimal.py:7: in <module>
    import welleng as we
E   ImportError: No module named welleng
______________ ERROR collecting tests/test_survey_interpolate.py _______________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/tests/test_survey_interpolate.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_survey_interpolate.py:1: in <module>
    import welleng as we
E   ImportError: No module named welleng
_______________ ERROR collecting tests/test_survey_parameters.py _______________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/tests/test_survey_parameters.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_survey_parameters.py:1: in <module>
    import welleng as we
E   ImportError: No module named welleng
_____________________ ERROR collecting tests/test_utils.py _____________________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/tests/test_utils.py", line 19
E       def _generate_random_dms(n: int, ndigits: int = None) -> NDArray:
E                                 ^
E   SyntaxError: invalid syntax
_______________ ERROR collecting work/connect_two_points_test.py _______________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/work/connect_two_points_test.py", line 22
E       f"Method: {section.method}\n",
E                                   ^
E   SyntaxError: invalid syntax
_____________________ ERROR collecting work/test_readme.py _____________________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/work/test_readme.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
work/test_readme.py:1: in <module>
    import welleng as we
E   ImportError: No module named welleng
______________ ERROR collecting work/test_survey_interpolation.py ______________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/work/test_survey_interpolation.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
work/test_survey_interpolation.py:1: in <module>
    import welleng as we
E   ImportError: No module named welleng
___________ ERROR collecting work/error_models/test_error_model_1.py ___________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/work/error_models/test_error_model_1.py", line 14
E       b_total=50_000.,
E                    ^
E   SyntaxError: invalid syntax
___________ ERROR collecting work/error_models/test_error_models.py ____________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/work/error_models/test_error_models.py", line 11
E       with open(os.path.join(PATH, f"{filename}.json"), 'r') as f:
E                                                     ^
E   SyntaxError: invalid syntax
_____________ ERROR collecting work/kick_tolerance/test_module.py ______________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/work/kick_tolerance/test_module.py", line 49
E       def get_figure_data(influx_depths: NDArray, results: List):
E                                        ^
E   SyntaxError: invalid syntax
___________ ERROR collecting work/optimize_utils/test_nev_to_hla.py ____________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/work/optimize_utils/test_nev_to_hla.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
work/optimize_utils/test_nev_to_hla.py:1: in <module>
    import welleng as we
E   ImportError: No module named welleng
____________ ERROR collecting work/petrosys/2021-08-08/test_data.py ____________
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/work/petrosys/2021-08-08/test_data.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
work/petrosys/2021-08-08/test_data.py:11: in <module>
    import pandas as pd
E   ImportError: No module named pandas
_________ ERROR collecting work/survey_to_plan/test_interpolate_tvd.py _________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/work/survey_to_plan/test_interpolate_tvd.py", line 80
E       f"N: {n:.2f}m<br>E: {e:.2f}m<br>TVD: {v:.2f}m<br>"
E                                                        ^
E   SyntaxError: invalid syntax
_____________ ERROR collecting work/wellpathpy/test_wellpathpy.py ______________
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/work/wellpathpy/test_wellpathpy.py", line 94
E       with open(f'{well}.csv', 'w') as csv_file:
E                             ^
E   SyntaxError: invalid syntax
______ ERROR collecting work/white_space/torque_drag/test_torque_drag.py _______
/usr/lib/python2.7/dist-packages/_pytest/python.py:507: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python2.7/dist-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E     File "/home/jonathancorcutt/Dropbox/GitHub/welleng/work/white_space/torque_drag/test_torque_drag.py", line 78
E       wob=10_000, tob=(2_000 * 1.356), overpull=50_000,
E                ^
E   SyntaxError: invalid syntax
______ ERROR collecting work/white_space/vertorized_clc/test_function.py _______
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/work/white_space/vertorized_clc/test_function.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
work/white_space/vertorized_clc/test_function.py:1: in <module>
    import numpy as np
E   ImportError: No module named numpy
_______ ERROR collecting work/white_space/vertorized_clc/test_ptpfuav.py _______
ImportError while importing test module '/home/jonathancorcutt/Dropbox/GitHub/welleng/work/white_space/vertorized_clc/test_ptpfuav.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
work/white_space/vertorized_clc/test_ptpfuav.py:1: in <module>
    import numpy as np
E   ImportError: No module named numpy
!!!!!!!!!!!!!!!!!!! Interrupted: 21 errors during collection !!!!!!!!!!!!!!!!!!!
=========================== 21 error in 0.62 seconds =========================== warning.
@jonnymaserati jonnymaserati merged commit 19c8004 into main Jan 28, 2024
4 checks passed
@jonnymaserati jonnymaserati deleted the enhancements/minor_updates branch January 28, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant