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

failing test on --python-only installation #19

Open
MichaelPotthoff opened this issue Nov 10, 2022 · 2 comments
Open

failing test on --python-only installation #19

MichaelPotthoff opened this issue Nov 10, 2022 · 2 comments

Comments

@MichaelPotthoff
Copy link

Hi
I finally managed to get tamoc installed on a windows machine. I can not use miniconda, thus I followed the manual installation procedure and installed the latest development version 2.4.0 (hint: avoid spaces in the path!) - I could not get it to work with my default IBM Fortran compiler, thus I choose to install the --python-only version. When i run the test I get a couple of assertion errors (and some deprecated warnings, that I could resolve):

NumPy: 1.23.4
SciPy : 1.9.3
Matplotlib: 3.6.2
netCDF4 : 1.6.1
xarray : 2022.10.0

C:\temp>pytest -v --pyargs tamoc
================================================= test session starts =================================================
platform win32 -- Python 3.10.7, pytest-7.2.0, pluggy-1.0.0 -- C:\Python\Python310\python.exe
cachedir: .pytest_cache
rootdir: C:\temp
plugins: anyio-3.6.2

=============================================== short test summary info ===============================================
FAILED test/test_blowout.py::test_simulate - AssertionError:
FAILED test/test_bpm.py::test_plume_objs - AssertionError:
FAILED test/test_bpm.py::test_simulate - AssertionError:
FAILED test/test_bpm.py::test_files - AssertionError:
FAILED test/test_sbm.py::test_ic - PermissionError: [Errno 13] Permission denied: b'C:\tamoc-master\tamoc\test\output\test_BM54.nc'
FAILED test/test_spm.py::test_plume_objs - PermissionError: [Errno 13] Permission denied: b'C:\tamoc-master\tamoc\test\output\test_BM54.nc'
=============================== 6 failed, 69 passed, 286 warnings in 100.92s (0:01:40) ================================

    for i in range(len(q0)):
      assert_approx_equal(spill.bpm.q[0,i], q0[i], significant=6)

E AssertionError:
E Items are not equal to 6 significant digits:
E ACTUAL: 0.0012566370614359175
E DESIRED: 1.29037789

c:\tamoc-master\tamoc\test\test_blowout.py:471: AssertionError

  assert_array_almost_equal(q_local.cte, np.array([4.36126913]), decimal=6)

E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 4.35702798
E Max relative difference: 0.99902754
E x: array([0.004241])
E y: array([4.361269])

c:\tamoc-master\tamoc\test\test_bpm.py:501: AssertionError

    for i in range(len(ans)):
      assert_approx_equal(bpm.q[0,i], ans[i], significant=6)

E AssertionError:
E Items are not equal to 6 significant digits:
E ACTUAL: 0.004241150082346221
E DESIRED: 4.36126914

c:\tamoc-master\tamoc\test\test_bpm.py:270: AssertionError

and some access permission error regarding netCDF:

c:\tamoc-master\tamoc\test\test_sbm.py:254:


c:\tamoc-master\tamoc\test\test_sbm.py:99: in get_profile
nc = make_ctd_file()
c:\tamoc-master\tamoc\test\test_sbm.py:76: in make_ctd_file
test_ambient.test_from_ctd()
c:\tamoc-master\tamoc\test\test_ambient.py:411: in test_from_ctd
nc = check_nc_db(nc_file, summary, source, sea_name, p_lat,
c:\tamoc-master\tamoc\test\test_ambient.py:100: in check_nc_db
nc = ambient.create_nc_db(nc_file, summary, source, sea_name, p_lat,
c:\tamoc-master\tamoc\ambient.py:1858: in create_nc_db
nc = model_share.tamoc_nc_file(nc_file, title, summary, source)
c:\tamoc-master\tamoc\model_share.py:65: in tamoc_nc_file
nc = Dataset(fname, 'w', format='NETCDF4_CLASSIC')
src\netCDF4_netCDF4.pyx:2463: in netCDF4._netCDF4.Dataset.init
???


???
E PermissionError: [Errno 13] Permission denied: b'C:\tamoc-master\tamoc\test\output\test_BM54.nc'

src\netCDF4_netCDF4.pyx:2026: PermissionError



The differences seem to be in an order of 1e3 and I am suspicious that there might be a wrong conversion factor somewhere. Any help is welcome, as I am am not very used in python.

@MichaelPotthoff
Copy link
Author

There are also a couple of runtime-errors, seemingly division by zero or invalid argument calls

@socolofs
Copy link
Owner

socolofs commented Nov 10, 2022 via email

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

No branches or pull requests

2 participants