$Id: TODO 290 2007-04-23 08:22:43Z wojdyr $

If you know C++ and would like to help in development of fityk, but
you don't know were to start, there is a list of ideas at the end of this file.

---------- TODO list and tentative development plan  ----------------
Legend:
// = done, but not tested/documented  

* BUG: "plot . []" sometimes doesn't work as expected if x axis is not visible

* GUI: fit run dialog should be hidden before fitting starts

* XPS Shirley background removing

* the API should be designed as Fityk class, rather than namespace,
  to enable multiple instances of the class. It involves making the whole
  library thread-safe.

* embedding python scripts or other plugin-like solution  [IMPORTANT]

* rewrite crystallographic part in python [IMPORTANT]

* BUG, parsing problem: "i $a*$a" => Syntax error; "i 0+$a*$a" => OK

* (?)exporting data with info "info @n () [range] > file"
  if not redirected, should display ... [1234 lines more] rather than all lines

* (GUI) stopping fitting interactively (when user doesn't want to wait longer);
  use threads? or wxTimer?

* GUI: buttons on sidebar>functions that make hwhm and shape equal
  for all functions (F[hwhm]=...; F[shape]=...) or independent.
  buttons should be active only when it's possible
   should also affect graphical peak adding (all 3 ways)

* GUI: in script editor, "info ...> file" should be marked differently
  than not redirected info 
  paths of files to be read should be checked 

* GUI: when printing, everything is first rescaled and rounded(!) for
  plot window at the screen, and then rescaled to the paper size. 
  This rounding causes visible artefacts at the printout.
  (wxDC.GetSize instead of plot.GetClientSize() ?)

* unused variables should not slow down fitting

* sorting lists at sidebar - by clicking on column header, 
  use case: sort functions by centers
  involves refactoring ListWithColors::populate()

* GUI: default view is too wide from the left in when logarithmic scale is on,
  because view margin is always 5%, and this is handled by libfityk

------------------ 

* GUI: script editor: button to change directories in absolute filenames

* GUI: menu and script editor: "create macro", 2-click access to scripts
   in .fityk/macro directory

* GUI: button '(un)lock' on variables pane [waiting for wx-toggle-bitmap-button]

* GUI: wxWidgets file dialog can't be customized, and there is no
  wxFileDialog-like widget (there is a wxGenericDirCtrl, but it doesn't look 
  good). Such a widget would be very useful in fityk. 
  
* [Infrastructure] Set up BuildBot or similar system for build tests

* GUI: use icons with alpha channel 
       http://www.wxwidgets.org/wiki/index.php/Embedding_PNG_Images

* GUI: menu file icons (16x15 or 16x16?)

* user defined functions:
      - more sophisticated simplifications of expressions and CSE(!)
      - calculating limits, width, area, etc. for UDF(!)

* un-strip background: what to do if active dataset is different than the one
  the background was removed for.

* EMG function: how to calculate it? Now there are some problems with
  this function. There must be smarter way to implement it...
  perhaps using gsl_sf_log_erfc

* (GUI) plot horizontal/vertical lines (X/Y | pos=2.34 | 100%)
     can be used to show theoretical peak positions in XRD

* ? GUI: changing data point size and line separately for each dataset,

* data load, ascii: optimize, loading many datafiles is slow

* info -- more informations about error, confidence limits, etc.
  graphical interface Fit > Info

* improve Voigt function (cut-tails, better approx.) 
  eg. http://portal.acm.org/citation.cfm?doid=77626.77629

* GUI: it should be possible to constrain two parameters of two peak,
     at least to make them equal.

* GUI: menu Functions:
  Functions > Peak-Find Info -> animation
  Functions > Multidata P-F Info -> window with list of parameters (Xview-like)

* Function: check_parameters_out_of_domain() ?  
             eg. in Pearson shape > 0.5 , shape < 1e9
	     called from fitting iteration?
	     what if parameter is out-of-domain? change? disable function?
	                                          change and freeze?
	     set fit-fix-parameters-times = 5
	    simple-var bounds?
	    ? $$simple = ~{min2(max2($simple, -1e9), 1e9)}

* GUI: Data Editor - left/right/top/bottom - magic keywords: user would be
       asked to select point/range/rectangle in plot

* cmd/GUI: plot peak-groups: ==> plot (%a+%b+%c)  

* (GUI) different peak-draft for sigmoids/steps (new function category), 
         and for other functions

* auto-freezing of peaks at disactivated range

* loading data -- this should be separated from the rest of the program.
  use Difdaf library (when it will be ready) for powder diffraction data import.
  other formats (from survey): .jdx JCAMP-DX (www.jcamp.org)
	         Galactic (GRAMS/32) SPC files (especially multifiles)
		 Vamas (vms), multipart Siemens .raw data files, uxd,udf
  perhaps OPJ with liborigin and XLS with another library
  Fast reading of ascii multicolumn files (benchmarks needed),
   with option to use different decimal separator (e.g. ',')
  see also description below

* (GUI) single dialog for configuring main plot (and also aux. plots) (?)
  data point size and other properties can be put on data pane(?)

* (GUI) vertical scaling using mouse on main plot near to left edge of the plot 

* (GUI, BUG) in Configure axes / peak labels: fonts are changed even
  if Apply is not pressed

* automatic background substraction - what are good algorithms?

* more sophisticated algorithms for peak detection

* fitting: GA fitting options, 
  a way to "shake" parameters for L-M

* fitting:
	simulated annealing (it can replace LM shake_before option)
	perhaps also BFGS, conjugate gradients methods

* fitting: it should be separated even more from the rest of the program.
  Perhaps it fitting functions should be in extern library (COOOL,
  GAUL, WNLIB, netlib, OOL.sf.net, levmar, GSL and 3rd-party extensions to GSL)
  are there any other such libraries? 
  I haven't investigated the possibility of using mentioned libs yet. 
  Links: 
  http://coool.mines.edu/ 
  http://gaul.sourceforge.net/, 
  http://www.willnaylor.com/wnlib.html
  http://sal.jyu.fi/B/3/index.shtml, http://coin-or.org
  http://www-unix.mcs.anl.gov/otc/Guide/faq/nonlinear-programming-faq.html 
  http://www.ics.forth.gr/~lourakis/levmar/

* fitting: robust fit - other error distributions then Gaussian, 
  eg. Lorenzian...; so called 'maximum-likelihood method' -- using Poisson
  error distribution.

* investigate LLVM - can it be used for faster calculation of 
  user-defined functions?

* [BUG] (GUI) (MS Win) <br> does not work in vertical peak labels 

* exporting formulae in MathML (when option formula-export-style == mathml)

* [BUG]: program crashes (MS Win 9x) when data contains NaN (as a result
  of asin(x) x>1) and "Zoom all" is called.

-------  Ideas for people, who would like to contribute:  -----------

- write a function to calculate a Voigt/Faddeeva function, based on one 
  (or more) of papers published about it. I mean here an approximation more 
  exact that the standard Humlicek one. GSL would probably also accept
  such a function in C.
  http://sources.redhat.com/ml/gsl-discuss/2004-q4/msg00061.html

- GUI/wxWidgets: file dialog in wxWidgets can't be customized, and there is no
  widget like GtkFileChooserWidget in gtk+. Implement such a widget, that
  will use GtkFileChooserWidget on GTK, perhaps also native implementation
  on other platforms, and a generic implementation, which can be based
  on generic wxFileDialog implementation.
  [Assigned to GSOC student]

- add import for new file formats or prepare a x-y data file reading
  library. Files requested by users include: .jdx JCAMP-DX (www.jcamp.org),
  Galactic (GRAMS/32) SPC files (especially multifiles), VAMAS ISO,
  multipart Siemens .raw data files and more. 
  The code to read popular powder diffraction data formats can be borrowed
  (with necessery modifications) from various open-source projects,
  i'm not sure how it's in other fields.
  Maintaining such a library could be quite rewarding, there are at least
  2-3 open-source project inclined to use it, the library would automatically
  go into a few popular Linux distributions, etc.
  [Assigned to GSOC student]

- if you have some expertise in nonlinear optimization methods, it's possible
  to do what Gnu Scientific Library seems to plan: put a few least-squares
  fitting methods with similar interface into one library. 
  It can be part of fityk, a separate library or a part of GSL.

- GUI: InputLine is a widget, that doesn't depend on the rest of fityk code.
  http://wxforum.shadonet.com/viewtopic.php?t=13005
  It would be nice to have tab-completion in InputLine, like we have in CLI,
  thanks to readline library. Ideally, the code for finding completion in CLI
  should be possible to use with InputLine.

- anything else

---------------------------------------------------------------------
