cemanetwork / appmar

APPMAR 1.0 - A toolbox for management of meteorological and marine data on limited information regions
MIT License
11 stars 1 forks source link

Unsuccessful error while installation #7

Closed murataksel closed 11 months ago

murataksel commented 11 months ago

Hi, While installing the code. It generates "Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source." and goes forward to the next package (repodata.json). After that it stays "solving environment" step.

dact221 commented 11 months ago

Hi @murataksel

Indeed, the first solving fails, and it then takes some more time. However, my conda managed to solve the environment after several minutes.

Can you specify your platform/OS and conda version? Also, did you follow the instructions in the README ou you tried a different approach?

If the solving just takes a lot of time, you could build a clone of my (already solved) environment from this file (it has installation instructions in the header):

environment.txt

Please, let me know if you have other problems.

Diego

murataksel commented 11 months ago

Hi Diego,

Your tool is very useful for coastal and ocean engineers. I would like to thank to you for this hard-intensive work and reply back my comment.

I solved problem with adding path of conda environments, restarting the computer (It is important I guess otherwise it generated the same error) and changing the conda version to 3.10.

It downloaded data and started to analyse it. While the analysing the data it generates following error for various coordinate but for the same date (2005-01).

I will try to re-download the data and try again. I will keep you update.

Many thanks again.

Murat.

"INFO:root:Reading nww3.tp.200501.grb C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\appmar\libappmar.py:381: FutureWarning: the 'line_terminator'' keyword is deprecated, use 'lineterminator' instead. df[df.columns[-1]][1:].to_csv(files[pid], header=False, line_terminator='\n') Traceback (most recent call last): File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\appmar\appmar.py", line 529, in on_roses ax = frm_canvas.fig.add_subplot(projection="polar") File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\matplotlib\figure.py", line 1419, in add_subplot a = subplot_class_factory(projection_class)(self, args, kwargs) File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\matplotlib\axes_subplots.py", line 76, in init self._axes_class.init(self, fig, self.figbox, kwargs) File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\matplotlib\projections\polar.py", line 795, in init super().init(args, **kwargs) File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\matplotlib\axes_base.py", line 439, in init self.set_figure(fig) File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\matplotlib\axes_base.py", line 581, in set_figure self._set_lim_and_transforms() File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\matplotlib\projections\polar.py", line 858, in _set_lim_and_transforms self.axesLim = _WedgeBbox((0.5, 0.5), File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\matplotlib\projections\polar.py", line 729, in init np.array([[0.0, 0.0], [1.0, 1.0]], np.float), File "C:\ProgramData\anaconda3\envs\my-new-env\lib\site-packages\numpy__init.py", line 305, in getattr raise AttributeError(former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations"

dact221 commented 11 months ago

Murat,

The issue seems to be upstream. There is an incompatibility between Maplotlib=3.2 and Numpy>=1.20.

I can only suggest you to downgrade Numpy in your environment:

conda activate YourEnvironment
conda install numpy<1.20

Let me know if it works for you, so I could update the dependencies for future reference.

Diego

murataksel commented 11 months ago

Dear Diego,

Yes it works. But I m working on Mediterranean Sea. In your model NWW3 Grid data can be used. I read that NWW3 model does not include Mediterranean Sea (https://polar.ncep.noaa.gov/mmab/tpbs/obsolete.tpbs/nww3tpb/nww3tpb.html) so APPMAR generates a blank graph with no data as expected.

image

Do you have any plan to extend your model input dataset like Copernicus Marine Data?

Best.

Murat.

dact221 commented 11 months ago

Hi Murat,

Indeed, NWW3 does not include inland water bodies. Given that limitation, we developed APPMAR 2.0 that uses the WW3 30-year Hindcast Phase 2 (NOPP Phase 2). NOPP Phase 2 has a dedicated 1/6° grid for the Mediterranean Sea (see the maps).

APPMAR 2.0 interface is better and gives more control to the user. One of the main advantages is that, in addition to performing the usual analyses, it provides you the raw data (.csv) at the chosen point so you could perform custom, more advanced analyses. You may also retrieve data from a different source and load a .csv file into APPMAR 2.0 to perform the analyses. Currently, mean climate analyses are implemented in 2.0 and are more informative/robust than those in 1.0. The extreme value analyses however are still incomplete.

I did some experiments with Copernicus data, in particular ERA5 global 0.5° hourly data. However, Copernicus requires a personal API key for APPMAR to integrate with the CDS client. Provinding my API key by default or asking the users to load their personal key into APPMAR does not seem to be a trivial decision. It seems that Copernicus uses the API key to track the volume of requested data per user. They also limit the size of the data requests. The latter complicates the download process because it forces me to implement some kind of heuristic to split the request in several requests depending on the amount of data.

I had more success with CAWCR Wave Hindcast. CAWCR data is hourly and 0.4° globally; however, this one is not very popular though it gives better results for some regions (e.g., in the South Atlantic). The CAWCR Hindcast is easier to implement into APPMAR becasuse it is available via NetCDF Subset Service, so the program can retrieve point data directly from the CAWCR servers instead of downloading the whole datasets and then extract a point in the user's machine.

Diego

murataksel commented 11 months ago

Dear Diego, Thanks for Appmar2 advice. I installed it as explained its own code. Downloaded Mediterranean 10 min dataset. As a second step while extracting for specified coordinate it generates following error:

Exception in thread Thread-2 (extract_series): Traceback (most recent call last): File "C:\ProgramData\anaconda3\Lib\threading.py", line 1045, in _bootstrap_inner self.run() File "C:\ProgramData\anaconda3\Lib\threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "C:\ProgramData\anaconda3\Lib\site-packages\appmar2\appmar2.py", line 199, in extract_series df[variables][1:].to_csv( TypeError: NDFrame.to_csv() got an unexpected keyword argument 'line_terminator'

Murat.

murataksel commented 11 months ago

I guess there is something wrong with the naming in code appmar2.py

image

image

dact221 commented 11 months ago

Hi Murat,

There was a change in the Pandas API. A prompt solution may be downgrade Pandas to <1.5.

I can update the call to Pandas' .to_csv() in the repo, but it will not be reflected in your current installation inmediately since I must create an installation package and uploaded it to PyPI for installation/update via pip. You could however run APPMAR 2.0 from source just after I commit the change to the repo.

Please, let's continue the discussion in the APPMAR 2.0 repo: https://github.com/cemanetwork/appmar2/issues/3

I will close this APPMAR 1.0 issue and update the dependency list to numpy<1.20. Thank you for the feedback.

Diego