Git Product home page Git Product logo

tpxo-tide-prediction's People

Contributors

fwrnke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tpxo-tide-prediction's Issues

write_tides error

I got write_tides work only if I change the arguments to this order write_tides(tide, "track", output_file="test.txt")

Install issue with VERSION file

Hi!
I was trying to download the model with pip install git+https://github.com/fwrnke/tpxo-tide-prediction.git after double checking I had pip installed in my conda environment.

However I keep running into an error when trying to import the package in a script. I used the suggested from tpxo_tide_prediction import (read_parameter_file, tide_predict, write_tides) but get FileNotFoundError: [Errno 2] No such file or directory: '\\lib\\site-packages\\tpxo_tide_prediction\\../VERSION .

I think I have tracked it down to the __init__.py file where it's trying to find VERSION in the directory above, however when downloading via the github link there is no file called VERSION downloaded and the directory above would be 'site-packages'.

For me installing via the zip file didn't work and I couldn't quite figure out why. So I have got around this problem by downloading the zip file and copying the VERSION file to the "\Lib\site-packages\tpxo_tide_prediction" file and changing the __init__.py to __version__ = open(os.path.join(os.path.dirname(__file__), 'VERSION')).read().rstrip('\n') instead of __version__ = open(os.path.join(os.path.dirname(__file__), '../VERSION')).read().rstrip('\n') so __init__.py can find it, a bit of a hacky solution.

I was thinking maybe it could do with having VERSION in the tpxo_tide_prediction-0.2.4.dist-info file maybe with __init__.py linking through to there? I am not super experienced when it comes to the intricacies of python packages so I wanted to let you know in case it is an actual issue as opposed to a me issue! If it is a me issue and I am doing something incorrectly then any advice would be appreciated!

Thank you!

Error on run basic example

I try to create a script to simulate tides with your project but raise this error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/xarray/core/dataset.py", line 1339, in _construct_dataarray
    variable = self._variables[name]
KeyError: 'lon_z'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/orionx/Insync/[email protected]/Google Drive/gravimetria/tpxo-tide-prediction/exemplo_tpxo.py", line 10, in <module>
    tide = tide_predict('/usr/local/lib/python3.10/dist-packages/tpxo_tide_prediction', lat, lon, times)
  File "/usr/local/lib/python3.10/dist-packages/tpxo_tide_prediction/predict_tide.py", line 155, in tide_predict
    h = read_h_netCDFs(paths_h, lat, lon, constituents, method=method)
  File "/usr/local/lib/python3.10/dist-packages/tpxo_tide_prediction/utils.py", line 723, in read_h_netCDFs
    lat_subset, lon_subset = subset_region(h, lat, lon, offset=offset)
  File "/usr/local/lib/python3.10/dist-packages/tpxo_tide_prediction/utils.py", line 507, in subset_region
    idx_max = ds[coords_lon].size - 1
  File "/usr/local/lib/python3.10/dist-packages/xarray/core/dataset.py", line 1430, in __getitem__
    return self._construct_dataarray(key)
  File "/usr/local/lib/python3.10/dist-packages/xarray/core/dataset.py", line 1341, in _construct_dataarray
    _, name, variable = _get_virtual_variable(self._variables, name, self.dims)
  File "/usr/local/lib/python3.10/dist-packages/xarray/core/dataset.py", line 177, in _get_virtual_variable
    raise KeyError(key)
KeyError: 'lon_z'

To understand what I'm doing wrong, I try to run a basic command-line example, and this error was raise:


orionx@unknown03293843927:~/Downloads/tpxo-tide-prediction$ predict_tide ./data examples/params_constant-lat_constant-lon_time.txt 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/xarray/core/dataset.py", line 1339, in _construct_dataarray
    variable = self._variables[name]
KeyError: 'lon_z'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/predict_tide", line 33, in <module>
    sys.exit(load_entry_point('tpxo-tide-prediction==0.2.3', 'console_scripts', 'predict_tide')())
  File "/usr/local/lib/python3.10/dist-packages/tpxo_tide_prediction/predict_tide.py", line 386, in main
    tide = tide_predict(args.model_dir, lat, lon, times, args.constituents,
  File "/usr/local/lib/python3.10/dist-packages/tpxo_tide_prediction/predict_tide.py", line 155, in tide_predict
    h = read_h_netCDFs(paths_h, lat, lon, constituents, method=method)
  File "/usr/local/lib/python3.10/dist-packages/tpxo_tide_prediction/utils.py", line 723, in read_h_netCDFs
    lat_subset, lon_subset = subset_region(h, lat, lon, offset=offset)
  File "/usr/local/lib/python3.10/dist-packages/tpxo_tide_prediction/utils.py", line 507, in subset_region
    idx_max = ds[coords_lon].size - 1
  File "/usr/local/lib/python3.10/dist-packages/xarray/core/dataset.py", line 1430, in __getitem__
    return self._construct_dataarray(key)
  File "/usr/local/lib/python3.10/dist-packages/xarray/core/dataset.py", line 1341, in _construct_dataarray
    _, name, variable = _get_virtual_variable(self._variables, name, self.dims)
  File "/usr/local/lib/python3.10/dist-packages/xarray/core/dataset.py", line 177, in _get_virtual_variable
    raise KeyError(key)
KeyError: 'lon_z'

What I'm doing wrong? Can you help me? ;)

__version__ variable missing

Dear developer,

I'm a power user of your tpxo-tide-prediction module and fire it up to create predicted tides for all our archived bathymetry expeditions. It is awesome and I'd like to thank you for that. However, I was working with an earlier version which had the __version__ variable still in place, which was useful, as I'm writing the tpxo-tide-prediction version to the tide files for reference. Now it's gone and I just get
module 'tpxo_tide_prediction' has no attribute '__version__'
Can you fix this please?

Forever grateful,
Yours,
simon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.