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

Cellbase preferences as part of cellbase mat-file #2

Open
torbenott opened this issue May 1, 2018 · 2 comments
Open

Cellbase preferences as part of cellbase mat-file #2

torbenott opened this issue May 1, 2018 · 2 comments

Comments

@torbenott
Copy link

torbenott commented May 1, 2018

Currently, cellbase preferences are stored in getpref/setpref('cellbase','preferencename','preferencevalue'). Since these preferences are not part of the cellbase mat-file (Cellbase.mat by default), they are not being directly shared when sharing cellbase files and cellbase data folder. In addition, choosecb() seems to have bugs not preserving all of the preferences of a cellbase. Most preferences are cellbase-specific, i.e. could be different for different cellbases.

I would suggest to save all cellbase-specific preferences in a PREFERENCES variable in the cellbase mat-file (Cellbase.mat by default). This would require small changes in quite a lot of locations, i.e. most calls of setpref/getpref. It would also not be fully back-compatible. The best feasible almost-back-compatible approach I can think of is having a function which creates default parameters in the new system if they are not already there, or reads from the current cellbase preferences.

@torbenott
Copy link
Author

I started a branch preferences 5657292 solving this issue.

There is a new variable PREFERENCES in the Cellbase.mat (default name) when calling initcb. It will initialize with default preferences. There are new getter/setter functions to set and get preferences. If there is no PREFERENCES variable, there is an import function, which can set default parameters or import from getpref('cellbase').

New functions

  • getcbpref
  • setcbpref
  • default_preferences
  • import_preferences

Note that default_preferences and import_preferences do have not be explicitly called. They are called in initcb and other functions when needed. When changing or accessing cellbase preferences, one should use the setter/getter getcbpref/setcbpref. Note also that there are still global cellbase settings such as filename and path to cellbase and data directories. These are also needed to support swichting between cellbases and accessed via setpref/getpref. I realize that this could be confusing so I ensured that you can also get and set those global preferences using the new functions getcbpref/setcbpref.

I also updated the function references, please check (in the database section).

Outstanding issues

  • please test & comment!
  • update general documentation and release notes, at least when merging to master.

@torbenott
Copy link
Author

now part of master in ac35a39. I'll leave the issue open for a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant