Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style/Consistency Checks #73

Closed
neil-glikin opened this issue Apr 28, 2022 · 7 comments
Closed

Style/Consistency Checks #73

neil-glikin opened this issue Apr 28, 2022 · 7 comments
Assignees
Labels
needs-brainstorm Further information is requested

Comments

@neil-glikin
Copy link
Collaborator

neil-glikin commented Apr 28, 2022

The general hope here is to make sure that use of IonSim is easy and intuitive for a user, basically matching up with intuitive expectation as best as possible. This is a list of some of my thoughts of items to consider for this. Many of them are questions about how we should handle stuff.

Julian/coding style

  • Is it bad form to have different methods defined in different files? (e.g. transitionfrequency, some in ions.jl and some in traps.jl)
  • Consistency of argument variable names (I vs ion)
  • Ordering of arguments (ion first/last, trap first/last?)
  • Use of "set" in functions that end in !
  • Function naming: eg stark_shift vs starkshift
  • Using functions to modify structs vs directly accessing them
  • Outputs for print/show
  • When/how errors are thrown/what type of errors vs warnings in various situations
    • Start error messages with capital or lowercase letters?
  • Defining a module: within the file or around the include statements for the file?
  • Import or export statements first?

Specific to IonSim

  • Is Efield_from_pi_time a good name
  • Default value of "timescale" should be 1, not 1e-6
  • How to make sure that making new ion species is "easy" based off of some template
  • Names of things
    • In particular "trap"
  • Enforcing m to be rational (where?)
  • Should we do intensity instead of E field
  • Some functions allow sublevels to be ID'd by an index (Int), but most don't. Should they? Which ones should?
  • Functions that involve a transition accepting a tuple as argument vs two different arguments
  • Use of ionposition vs position
  • Setting of parameters when constructing stuff
    • Be able to set mode Fock state size when creating rather than having to reference and then set mode.N =
  • Be able to set constant parameters in a nice way (e.g. L.E returns a number not a function)
  • "stark shift" should be named something different so that it's not confusing
  • Ability to construct from top down: set up an empty Chamber first, then fill it in
@marwahaha
Copy link
Member

goal: making docstrings have consistent style

@neil-glikin
Copy link
Collaborator Author

Just updated first comment

@neil-glikin
Copy link
Collaborator Author

@marwahaha
Copy link
Member

@marwahaha
Copy link
Member

marwahaha commented Sep 21, 2022

from Kristian (see also #95)

It would be nice to create an empty Chamber(), then we consider the trapping potentials for the ions in IonTrap, then add the Laser and IonTrap into the Chamber.

@marwahaha
Copy link
Member

Also: Is our convention for phrases:

with underscores, like ion_configuration
with capital letters, like IonConfiguration
with no spacing, like ionconfiguration

@marwahaha marwahaha added needs-brainstorm Further information is requested and removed before-1.0 labels Sep 22, 2022
@jbroz11
Copy link
Member

jbroz11 commented Sep 23, 2022

I've been following ion_configuration for file names. IonConfiguration for structs and ionconfiguration for function names. Sometimes I break the last rule if it is not readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-brainstorm Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants