Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
owc-software-python owc-software-python
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • bodc
  • owc-software-pythonowc-software-python
  • Merge requests
  • !7

Merged
Created Oct 02, 2019 by edsmall@edsmallContributor

ARGODEV-138: cal2dec

  • Overview 0
  • Commits 12
  • Pipelines 15
  • Changes 3

Jira Issue

https://jira.ceh.ac.uk/browse/ARGODEV-138

Python Implementation

The python implementation mostly mirrors the original Matlab code, with two slight changes:

  1. There is some error handling if the user tries to access a month that does not exist (eg the 14th month of the year)
  2. There is some error handling if the calculated day of the year exceeds 366 (ie. is more than a leap year)

I have been informed that there is some date checking of the data earlier during the real time checks, so I should not expect for there to be an "impossible date" here

Testing

To test cal2dec 5 simple tests were written:

  1. Is the return type a float?
  2. Does the function raise an exception if the input month does not exist?
  3. Does the 0th minute of the 0th hour on the 1st day of the 0th month return 0?
  4. Does the 0th minute of the 24th hour on the 31st day of the final month return 365?
  5. Does the function raise an exception if the calculated decimalised date is over 366?

Old Matlab Implementation

Used to calculate the decimalised version of a calendar date. Inputs are a month [int], a day [int], an hour [int] (optional argument), and a minute [int] (optional argument). Optional arguments default to 0.

Edited Oct 30, 2019 by edsmall
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: edsmall/cal-2-dec