Coder Social home page Coder Social logo

Comments (5)

lilyclements avatar lilyclements commented on September 10, 2024

We use station_id in geoclim functions. Is this different to station?

from cdms.products.

isedwards avatar isedwards commented on September 10, 2024

In case it's useful, each of these examples mean something very specific in Python, especially when working with databases and using object relational mapping: station would be an object (instance) that represented a row in the database with each database column as a property, e.g. station.name, station.latitude, ... , station.id.

It's very common to have a variable called station_id, of type Integer or String, that contains a value taken from a station.id.

I would expect elements and stations to be collections containing multiple objects of type element and station respectively.

date_time would be an instance of DateTime (a date with a time) whilst date would be a Date object without a time.

from cdms.products.

dannyparsons avatar dannyparsons commented on September 10, 2024

Thanks @isedwards that's useful context.

In these functions, the first argument is a data frame and these extra arguments specify the column names in the data.

So I think keeping them short and simple would be good and in line with R best practice. So although they are strings specifying a column name, I don't think we should be adding something like _name or _col to all the arguments, although that would distinguish them more from "objects". It should be clear from the function signature and documentation that these are names of columns in data.

On those specific names:

  • I think I prefer date_time to date because it will be a date with time in some cases
  • element if it's a single column and elements if multiple columns can be given
  • station if it's a station identifying column name.

For functions where station is used for facets, I prefer using station because it could be either station_id or station_name.
For geoclim the station_id is required specifically. So I think that's the distinction.

Thanks for helping to get the consistency here @lilyclements

from cdms.products.

lilyclements avatar lilyclements commented on September 10, 2024

I think I prefer date_time to date because it will be a date with time in some cases

@dannyparsons should we have date_time as the parameter name in functions where the function accepts a date-time object, but doesn't necessarily make sense - e.g. dekad, pentad?

from cdms.products.

dannyparsons avatar dannyparsons commented on September 10, 2024

Yes that sounds good. Pretty much everywhere that we use a Date could also be a Date-time as we're generally using it to extract components or as a time series sequence, which could include a time component too.

from cdms.products.

Related Issues (20)

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.