$Id: TODO 345 2007-08-21 01:09:15Z 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  

* 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() ?)

* 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

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

* (GUI) stopping fitting interactively (when user doesn't want to wait longer);
  "stop" bitmap button? in right left corner? 

* refactor guess.cpp to be thread-safe

* GUI: should (and where) windows size & position be stored?

* data: integrate fityk with xylib written by Peng Zhang as GSOC project

--------------> 0.8.3

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

* making libfityk thread-safe (pass around Fityk* F, remove all `AL',
   remove static class members and global variables)

* embedding python scripts or other plugin-like solution  [IMPORTANT]
  perhaps IPC instead of embedded scripting language?

* 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: 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 

* unused variables should not slow down fitting

* add alpha channel to toolbar icons

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

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

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

* GUI: [when wx3 is released, with customizable file dlg] change file dialogs
  
* [Infrastructure] Set up BuildBot or similar system for build tests

* 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

* (GUI) single dialog for configuring main plot (and also aux. plots) (?)

* (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

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