British-Oceanographic-Data-Centre / COAsT

A Coastal Ocean Assessment Tool built as an extendable python framework for nemo models
https://british-oceanographic-data-centre.github.io/COAsT/
MIT License
24 stars 11 forks source link

Standardized tide gauge objects #651

Closed soutobias closed 10 months ago

soutobias commented 11 months ago

Pull request checklist

Please check if your PR fulfills the following requirements:

Pull request type

Please check the type of change your PR introduces:

What is the current behavior?

Some lint problems, deprec functions and not-standard Tidegauge objects

What is the new behavior?

I made the following changes in the code:

  1. Standardized tide gauge objects (gesla, HLW, BODC) by ensuring consistent dimensions, coordinates, variables, and attributes. Renamed id_station to site_name and added the ssh variable. This is the standard:

image

  1. Optimized methods in HLW, removing unnecessary loops in file opening.

  2. There's an issue converting datetime from Europe/London to UTC because certain datetimes, like "25/10/2020 01:18," can be ambiguous (BST or not). While you previously encountered this with pytz without noticing, using pandas now highlights this ambiguity. I employed the pytz convention treating ambiguous datetimes as BST, but I'm uncertain if this is the optimal solution.

  3. Updated tests, ensuring all pass successfully.

  4. Revised notebooks and added an example in tidegauge validation on opening BODC files.

  5. Flagged the deprecated method read_gesla_v3 and the class Process_data with a deprecation decorator. Updated the class name to camel case ("ProcessData").

  6. Corrected linting issues in the code.

Checklist

Does this introduce a breaking change?

Other information

soutobias commented 11 months ago

@jpolton , could you please take a look if everything is okay? Please see the comments that I included in the new behavior section of the first comment.