OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
247 stars 121 forks source link

OpenOil Noaa #52

Closed dharanidharan12 closed 5 years ago

dharanidharan12 commented 7 years ago

In Openoil3D: Getting Error: 'OilProps' object has no attribute 'oil_water_surface_tension' Why I am getting this issue. Please Help to Resolve the error.. Thanks in Advance!!!

knutfrode commented 7 years ago

Probably your version of NOAA OilLibrary is outdated. Please update both OpenDrift and OilLibrary to the latest versions, to ensure compatibility. Note that OilLibrary needs to be recompiled with python setup.py remake_oil_db after updating the code.

HanhHelen commented 6 years ago

Dear authors, When testing the oillibrary, i have the problems: FAIL: test_dispersion (main.TestOil) Traceback (most recent call last): File "C:/opendrift-master/tests/test_oillibrary.py", line 92, in test_dispersion fraction_dispersed) AssertionError: 0.09339651 != 0.068167008 within 7 places

====================================================================== FAIL: test_droplet_distribution (main.TestOil) Traceback (most recent call last): File "C:/opendrift-master/tests/test_oillibrary.py", line 130, in test_droplet_distribution self.assertAlmostEqual(d.mean(), 0.00006904389) AssertionError: 5.763371939835245e-05 != 6.904389e-05 within 7 places

Would you please to help me?

knutfrode commented 6 years ago

Maybe you have an old version of either software? You may check version numbers by:

>>> import opendrift
>>> opendrift.__version
'1.0.3'
>>> import oil_library
>>> oil_library.__version__
'1.0.6'

These are the latest versions, which should work well together.

HanhHelen commented 6 years ago

I have these version. I don't know why ???

knutfrode commented 6 years ago

Is this the only test which fails?

Can you paste here the full output you get when running the test test_oillibrary.py ? (or send the complete output from testall by email to knutfd@met.no)

HanhHelen commented 6 years ago

This is the output when I run the test test_oillibrary.py:

runfile('C:/opendrift-master/tests/test_oillibrary.py', wdir='C:/opendrift-master/tests') No display found. Using non-interactive Agg backend c:\opendrift-master\opendrift\models\basemodel.py:42: UserWarning: This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called before pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time.

The backend was originally set to u'Qt4Agg' by the following code: File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\spyder\utils\ipython\start_kernel.py", line 268, in main() File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\spyder\utils\ipython\start_kernel.py", line 252, in main kernel.initialize() File "", line 2, in initialize File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error return method(app, *args, kwargs) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\ipykernel\kernelapp.py", line 464, in initialize self.init_code() File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\shellapp.py", line 266, in init_code self._run_exec_lines() File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\shellapp.py", line 292, in _run_exec_lines self.shell.run_cell(line, store_history=False) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\ipykernel\zmqshell.py", line 537, in run_cell return super(ZMQInteractiveShell, self).run_cell(*args, *kwargs) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\interactiveshell.py", line 2718, in run_cell interactivity=interactivity, compiler=compiler, result=result) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\interactiveshell.py", line 2828, in run_ast_nodes if self.run_code(code, result): File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\interactiveshell.py", line 2882, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in get_ipython().kernel._set_mpl_backend('qt4', True) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\spyder\utils\ipython\spyder_kernel.py", line 498, in _set_mpl_backend get_ipython().run_line_magic(magic, backend) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\interactiveshell.py", line 2081, in run_line_magic result = fn(args,kwargs) File "", line 2, in pylab File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\magic.py", line 188, in call = lambda f, *a, *k: f(a, **k) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\magics\pylab.py", line 156, in pylab gui, backend, clobbered = self.shell.enable_pylab(args.gui, import_all=import_all) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\interactiveshell.py", line 2989, in enable_pylab gui, backend = self.enable_matplotlib(gui) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\interactiveshell.py", line 2950, in enable_matplotlib pt.activate_matplotlib(backend) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\IPython\core\pylabtools.py", line 309, in activate_matplotlib matplotlib.pyplot.switch_backend(backend) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\matplotlib\pyplot.py", line 232, in switch_backend matplotlib.use(newbackend, warn=False, force=True) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\matplotlib__init.py", line 1305, in use reload(sys.modules['matplotlib.backends']) File "C:\WinPython27\python-2.7.13.amd64\lib\site-packages\matplotlib\backends\init__.py", line 14, in line for line in traceback.format_stack()

matplotlib.use('agg') C:\WinPython27\python-2.7.13.amd64\lib\site-packages\scipy\optimize\minpack.py:785: OptimizeWarning: Covariance of the parameters could not be estimated category=OptimizeWarning) Dispersion fraction 0.000000 for SMORBUKK KONDENSAT and wind speed 3.000000 FDispersion fraction 0.093397 for SMORBUKK KONDENSAT and wind speed 8.000000 TIMING: (8.96s) main.TestOil.test_dispersion FTIMING: (0.56s) main.TestOil.test_droplet_distribution .TIMING: (0.72s) main.TestOil.test_no_dispersion *GENERIC MEDIUM CRUDE 0.18113588361019167 .AASGARD BLEND, STATOIL 0.5357305057872878 TIMING: (0.91s) main.TestOil.test_oils

====================================================================== FAIL: test_dispersion (main.TestOil)

Traceback (most recent call last): File "C:/opendrift-master/tests/test_oillibrary.py", line 92, in test_dispersion fraction_dispersed) AssertionError: 0.09339651 != 0.068167008 within 7 places

====================================================================== FAIL: test_droplet_distribution (main.TestOil)

Traceback (most recent call last): File "C:/opendrift-master/tests/test_oillibrary.py", line 130, in test_droplet_distribution self.assertAlmostEqual(d.mean(), 0.00006904389) AssertionError: 5.763371939835245e-05 != 6.904389e-05 within 7 places


Ran 4 tests in 11.180s

FAILED (failures=2)

I also have the same problem with the test_stranding.py. So from testall I have: Output of testall.docx

Hope you can find out what happened.