Projects and files
- Projects
- New Project
- Open Project
- Open Recent
- Save Project
- Save Project As
- What a project file holds
- The .fitproj file format
- Where the data came from
- Unsaved changes
- Import Profile
- Two-column data files (.dat)
- Tables of numbers (.csv, .tsv, .xlsx, .ods)
- Reload Profile
- Export Curve Parameters
- Export Summary Table
- Quit
- Sample data
- Command-line options
- Log files
- What Fit remembers on this computer
- Where Fit keeps its files
Projects
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
A project is your whole piece of work in one file, so that you can close Fit and later carry on fitting from where you stopped.
A project holds the data, everything you marked on it, the model, the values the last fit found and how the window was set up. Opening it again does not merely redraw what you had: the fitted values stay attached to the curves they belong to, so the next fit continues from them.
Project files end in .fitproj. The File menu holds the commands for them:
- File > New Project (Ctrl+N) starts empty.
- File > Open Project (Ctrl+O) opens a saved project, and File > Open Recent offers the last few again.
- File > Save Project (Ctrl+S) and File > Save Project As (Ctrl+Shift+S) write the project.
- File > Import Profile (F2) and File > Reload Profile bring data from a file into the project.
- File > Export > Curve Parameters and File > Export > Summary Table write a table of results as text.
Saving and exporting are different things. A saved project can be opened again and is how you keep your work. An export is a one-way copy of a table for a spreadsheet or a script: Fit cannot open it again, and exporting does not count as saving.
The project open when you last closed Fit opens by itself at the next start.
Limitations
- On macOS the shortcuts use the Command key instead of Ctrl.
See also: What a project file holds · Save Project · Import Profile · Unsaved changes
New Project
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > New Project closes what is open and leaves an empty window, ready for a profile to be imported.
The profile, the background points, the fit intervals, the curve positions and the model are all removed from the window, and the title bar shows the program's name again. The new project has no file yet: the first File > Save Project asks for a name.
It also means no project will open by itself at the next start, until you open or save one.
The shortcut is Ctrl+N. The command is always offered.
With unsaved work in the window, it first asks whether to save the project, as closing the window does: Yes saves and then clears, No clears without saving, and Cancel - or a save that does not happen - leaves everything as it was.
See also: Save Project · Import Profile
Open Project
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Open Project asks for a .fitproj file and restores the work it holds.
The dialog shows project files (*.fitproj), and can be switched to all files for a project that was renamed. Opening restores the profile, the background points, the fit intervals, the curve positions, the settings and the fitted values, and then the working context: the argument axis, the picking mode, the table in front, the chart tab in front, the selected curve and, if you had zoomed in, the part of the chart you were looking at. The title bar shows the project's file name.
The R-factor is not recalculated on opening. Until you fit again it reads as not calculated; the value the project recorded stays in the file.
If the file cannot be used, a message says why and the work already in the window is left as it was. Typical reasons: there is no file at that path, the file is not a Fit project, or it needs a newer version of Fit - the message then names the format version it needs and the one this build reads.
If the project names a curve type this build does not have, for example peaks opened in a build without them, the project still opens with its data, its fit intervals and its settings, but without its model: the curves, their positions and their fitted values belong to that curve type, and built with another one they would be a model the file never held. The models in its history are left out for the same reason. The file still holds them all, and the project opens as a new one: the title still names the file it came from, but saving it asks for a new file name, so the original keeps its model. What a module of that pack keeps is kept in the file as it was, so a build with the module reads it again. A message says which of these the project held.
The shortcut is Ctrl+O. The command is always offered. A project can also be opened from the command line with --project, and on Windows by double-clicking a .fitproj file when the installer was allowed to associate the extension with Fit.
With unsaved work in the window, it first asks whether to save it, before the file dialog opens - the same question and the same answers as File > New Project. File > Open Recent asks it too.
Limitations
- A project saved before October 2026 names its curve type only by a code, so a build without that type can name it no other way.
See also: Open Recent · What a project file holds · Where the data came from · Command-line options
Open Recent
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Open Recent lists the projects you opened or saved most recently, newest first, and opens one with a click.
Each line is the whole path of a project, because two projects in different folders often have the same name. At most eight are kept. Opening or saving a project already in the list moves it to the top instead of listing it twice; two spellings of one path that differ only in capital letters count as the same project.
With no project remembered, the submenu shows one greyed line, (none), so that you can see the list is empty rather than missing.
The project at the top - the one open when Fit was last closed - opens by itself at the next start. If it has been moved or deleted in the meantime, Fit starts with nothing open, writes a warning to the log, and drops that project from the list.
The list belongs to this computer, because a path names a file on one machine. It is the recent section of settings.json, the one file in which Fit keeps what it remembers on this computer (see What Fit remembers on this computer), and it is written as soon as a project is opened or saved. On Linux that file is in ~/.local/state/fit, the folder the XDG Base Directory Specification names for state such as recently used files.
Limitations
- A project deleted while Fit is running stays in the list until the next start; clicking it reports that there is no project at that path.
- A copy started by the build script of a source tree shares the list with an installed copy on the same computer, as it shares every other setting.
Sources
- freedesktop.org, "XDG Base Directory Specification", version 0.8 - $XDG_STATE_HOME https://specifications.freedesktop.org/basedir-spec/latest/
See also: Open Project · What Fit remembers on this computer
Save Project
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Save Project writes the project to its file, and asks for a name the first time.
A project that has never been saved has no file yet, so the first save behaves exactly like File > Save Project As. After that, File > Save Project writes to the same file without asking.
When the save succeeds, the title bar shows the project's file name, the project becomes the one that opens at the next start, and it moves to the top of File > Open Recent. If it fails - no such folder, no permission, a full disk - a message says why, the project still counts as unsaved, and the file already there is left exactly as it was: the new file is written beside it and takes its name only once it is complete.
The shortcut is Ctrl+S. The command is greyed out until a profile has been imported or a project opened: there is nothing to save before that.
See also: Save Project As · What a project file holds · Unsaved changes
Save Project As
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Save Project As always asks for a file name and saves the project there.
Use it to keep a copy under another name, for example before trying a different model. From then on the window works on the new file: File > Save Project writes there.
If you type a name with no extension, .fitproj is added. A name you give with your own extension is kept as you typed it.
If a file of that name already exists, Fit asks whether to replace it, naming the file. The question is asked after the extension has been added, so it is about the file that would really be written. Answering No writes nothing and changes nothing.
The shortcut is Ctrl+Shift+S. The command is greyed out until a profile has been imported or a project opened.
See also: Save Project · The .fitproj file format
What a project file holds
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
A project holds the data and everything needed to continue fitting it, but nothing that can be recalculated from those.
Stored in the file:
- The profile as the program holds it at the time of saving, that is, after any background subtraction or smoothing.
- Your background points, fit intervals and curve positions, and which curve each position belongs to. A background curve is stored as its parameters like every curve; the values the background's table lists for it are computed from them when the project is opened, not stored. A project written when a model had both a curve and selected points keeps the points and leaves the curve out, and says so.
- The settings of the fit: the curve type, the maximum acceptable difference, the minimizer, the loss function, the weighting, whether curve scaling is on, and the background curve the model has, if any.
- For every curve, its fitted parameter values with their errors, and whether a fit produced them.
- The R-factor and the statistics of the fit that was saved.
- The formula and parameters of a user-defined curve, if one is in use.
- The stretch of the profile you selected, if any, and where the data came from.
- The working context: the argument axis (including a custom axis you defined), the R-factor scale chosen under View > R-factor Scale, the picking mode, the table in front, the chart tab in front, the selected curve and the part of the chart you had zoomed in on. The zoom comes back only on the same axes: a window measured on one axis says nothing about another, so after an axis change the whole data is shown.
- What any analysis module keeps about the model, in a part of its own.
- The model history: every model a fit reached in this project, which one each was fitted from, which one is current and the names you gave them. Each profile a model was fitted to is stored once, however many models share it.
- When the project was created and last saved, in UTC, and which version of Fit wrote it.
Not stored: the calculated profile, the difference, the curves' own points and where the fitted curves sit. They are recalculated from what is stored, so a project cannot disagree with its own model. Also not stored: the window's size and layout, and the settings that belong to your installation rather than to the work, such as the compute server's address or Animation Mode.
The original data file is not needed to open a project: the profile is inside it. The file's path is recorded, but only so that you can tell where the data came from.
Limitations
- A parameter that is not a number - a label or a handle some curve types keep - is not stored. It is rebuilt from what the module keeps when the model is rebuilt.
See also: The .fitproj file format · Where the data came from · What Fit remembers on this computer
The .fitproj file format
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
A .fitproj file is a ZIP archive of JSON parts, which any archive tool can open.
It is the same arrangement that .xlsx and OpenDocument files use. If something goes wrong you can unpack a project and read what it holds. The parts are:
- manifest.json - which version of the format and of Fit wrote the file, the oldest format version a reader must understand to open it, and when it was created and saved.
- problem.json - the profile, the background points, the fit intervals, the curve positions, the settings, the selected stretch, a user-defined curve and where the data came from.
- results.json - the fitted values of every curve, the R-factor and the fit statistics.
- ui.json - the working context of the window.
- modules/<module>.json - one part for each analysis module that keeps something.
- history/index.json, history/entries/<id>.json and history/profiles/<hash>.json - the model history: its lineage and names, each run's log and its R-factor as it went, one part per recorded model in the same form as problem.json and results.json, and one part per profile. A project with no history has none of these parts.
Old and new versions of Fit get along. When an older version opens a project written by a newer one and saves it, the parts and the entries it does not understand are written back unchanged, so passing a file between versions does not quietly lose work. A project that truly needs a newer reader is refused with a message saying so, rather than opened half understood.
Numbers are written at full precision, so a value comes back exactly as it was saved.
Limitations
- Editing the parts by hand is possible but unchecked: a value that does not make sense may be refused, or taken as it is, when the project is opened.
Sources
- PKWARE Inc., APPNOTE.TXT - .ZIP File Format Specification https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
- T. Bray (ed.), The JavaScript Object Notation (JSON) Data Interchange Format, RFC 8259 https://www.rfc-editor.org/rfc/rfc8259
See also: What a project file holds
Where the data came from
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
A project remembers which data file it was imported from, and notes in the log when that file no longer says the same thing.
When a profile is imported, Fit records the file's path, its size, a fingerprint of its contents (an MD5 hash) and the kind of file it was. All of it is saved with the project.
When the project is opened again, Fit reads the file at that path, if it is still there, and compares its contents with the fingerprint. If they differ, a warning goes to the log naming the file. Nothing in the project changes: it still holds the data it was fitted to. The notice is there so that a result which no longer matches its input can be noticed rather than puzzled over months later.
The contents are compared rather than the file's date, because copying or restoring a file changes its date without changing the data, and an edit can leave the date as it was.
Limitations
- When the file is gone, cannot be read, or the project was saved by a version that recorded no fingerprint, nothing is said: Fit cannot tell, and does not guess that the data changed.
- The fingerprint guards against accidents - a re-export, an edited column, a truncated copy - not against someone deliberately forging a file.
See also: Log files · Reload Profile
Unsaved changes
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
Closing Fit, starting a new project or opening another with unsaved work asks whether to save the project first, and a save that does not happen stops the command.
Whether you close the window, use File > Quit, or replace the project with File > New Project, File > Open Project or File > Open Recent, Fit asks whether to save the changes to the project - named by its file, or by its data while it has none, or Untitled - when there is unsaved work, and does not ask when there is none.
- Save saves, exactly as File > Save Project does - asking for a name if the project has none - and then closes. If you cancel that name dialog, or the save fails, the window stays open, because closing then would lose the work you asked to keep.
- Don't Save closes without saving.
- Cancel, or closing the question, keeps the window open.
Work counts as unsaved when anything a save would write has changed since the project was last opened, saved or started from an imported file: the points picked for the background, the fit intervals or the curve positions, the model, a fit result, a setting. Choosing an axis counts, since the project keeps it; the table in front, the chart tab in front, the selected curve and the zoom do not, and neither does exporting a table.
When nothing has been changed, sent to the engine or recorded in the history since then, there is nothing to look for and the window closes at once. Otherwise Fit compares the project with its file before it asks, which for a large project takes a few seconds: the status bar says "Looking for changes ... that are not saved" under the busy cursor meanwhile. Opening and saving a large project say "Opening ..." and "Saving ..." there in the same way, and any message they have waits until they are done. A step that lasts longer than a moment also opens a small window over the main one, naming what it is doing now - reading the file, drawing the model, putting the window back as it was saved, finishing the drawing - with a moving bar and the seconds gone by. It closes once everything is drawn, so the window is ready to use the moment it goes. The main window goes on answering meanwhile, so it can be moved and is redrawn, but it takes no command until the step is over: a command started in the middle of an open would act on a project only half read.
File > Import Profile and File > Reload Profile ask a question of their own, about the model they discard.
See also: Save Project · Quit
Import Profile
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Import Profile reads a data file and makes it the profile of the current project.
The dialog, Open Profile Data, starts where your data is: in the folder of the file the open project's data was read from; failing that, in the folder of the file last chosen in it; then beside the project file; and otherwise in your home folder. Data fetched by a data source is kept in a folder of the program's own, which the dialog does not start in. It offers the formats this build can read: All supported, then one entry per format, then All files. The file's extension decides how it is read, whatever its capitals:
- .dat - a two-column text file, argument and value. An analysis module may read it as a kind of data of its own, and the dialog then names it so. .xy and .txt are read the same way.
- .csv and .tsv - a table of numbers, its columns named in a header line; the first two columns of numbers are the argument and the value. An analysis module may read .csv as a kind of data of its own - price bars, say - and then it is that.
- .xlsx and .ods - a workbook, whose first sheet is read as the same kind of table.
A file with any other extension is refused with a message naming the extension no reader handles. An analysis module can add formats of its own; the dialog then lists them too.
Importing starts the model again: the curves, the picks and the fitted parameters describe the data being replaced. So when the project has curves or unsaved work, Fit first asks, naming the file, whether to replace the data and discard the current model. With nothing to lose it does not ask.
Afterwards the profile is on the chart and in the Data tab, and the title bar shows the data file's name. The project keeps its own file: File > Save Project saves the new data into it. The data file's path, size and fingerprint are recorded for the project.
The shortcut is F2, and the first toolbar button does the same. The command is always offered.
Limitations
- There is no choice of columns in the dialog: a .dat file is always read as its first two numbers per line, and a table as its first two columns of numbers. File > New Project from Data Source offers the choice for a table it downloads.
See also: Two-column data files (.dat) · Tables of numbers (.csv, .tsv, .xlsx, .ods) · Reload Profile · Sample data · Where the data came from
Two-column data files (.dat)
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
A .dat file is plain text with the argument and the measured value on each line, and Fit reads the first two numbers of every line.
Each line should hold two numbers: first the argument (for a diffraction pattern, the angle), then the value (the intensity). Anything that is not part of a number separates numbers, so spaces, tabs and semicolons all work. For example:
116.0000 773.00
A number may have a sign (-1.5, +2) and an exponent (1.5e3, 2E-2). Its decimal mark may be a full stop or a comma. A comma is read as a decimal mark only on a line that writes no full stop, and only while that still leaves two numbers: 1,5;2,5 is one and a half and two and a half, while 12,40 and 12.5,40.0 are both pairs.
What the reader does without saying so:
- A line with fewer than two numbers - a heading, a comment, a blank line - is skipped, as is a line holding a malformed number such as 1.2.3.
- Everything after the second number on a line is ignored, so a third column (an error, say) is dropped.
- A line whose argument is already in the file is skipped; the first one wins.
- A minus sign written straight after a digit separates two numbers: 10-20 is the pair 10 and 20.
Limitations
- A comment line that happens to contain two numbers (# run 3 of 5) is read as a data point. Start such lines with no numbers, or remove them, and compare the Data tab with the file.
See also: Import Profile · Sample data
Tables of numbers (.csv, .tsv, .xlsx, .ods)
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
A .csv or .tsv file is a table, and so is the first sheet of an .xlsx or .ods workbook; Fit reads the first two columns of numbers as the argument and the value and keeps the rest beside them.
This is the shape most published data comes in: a header line naming the columns, then one line per measurement, the cells separated by commas, tabs or semicolons. Fit works out which of the three separates the cells from the lines themselves, so a file named .csv that uses semicolons is read as well. For example:
angle,intensity,background
10.0,773,12
What the reader decides, and how:
- The header is the first line of two or more cells above the data; a line of units under it is not taken for the names. A table with no header gets Column 1, Column 2 and so on.
- A column is a column of numbers when at least half of its cells are numbers, so a column of sample names or dates is left out, and a stray "n/a" costs only its own cell.
- A comma is a decimal mark only in a table that does not separate its cells with commas and writes no number with a full stop: 1,5;2,5 is one and a half and two and a half.
- A cell in double quotes may hold the separator; lines starting with # or % are comments.
- A line without both an argument and a value is skipped, and a line whose argument is already in the table is skipped too; the first one wins, as in a .dat file.
The columns after the second are kept with the profile under their names, and the project saves them. File > New Project from Data Source shows them in its preview as a choice of value column.
A workbook's first sheet is read cell by cell as it is stored: a number is its value, not the text a cell shows, and the other sheets are not read.
Limitations
- Only the first two columns of numbers become the profile when the file is imported directly: there is no choice of columns in File > Import Profile.
- A number written with a thousands separator (1,234.5) is not read as a number.
- The old binary .xls format is not read; save the workbook as .xlsx or .ods, or the sheet as .csv. A date in a spreadsheet is stored as a day count, and reads as that number.
- Only the first sheet of a workbook is read.
See also: Import Profile · Two-column data files (.dat)
Reload Profile
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Reload Profile reads the data file the open project came from again, for when it has changed on disk.
It re-reads the file the project records as its source - the one imported last, or for a project opened from disk the one it was built from - in the same way it was read the first time, and replaces the profile with what it finds.
Like importing, it starts the model again, so when the project has curves or unsaved work Fit first asks whether to go on.
When the project names no data file, or the file is no longer where it was, Fit says so and reads nothing; use File > Import Profile to choose the file.
The command is greyed out until a profile has been imported or a project opened. It has no shortcut.
See also: Import Profile · Where the data came from
Export Curve Parameters
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Export > Curve Parameters writes the Curve Attributes table to a tab-separated text file.
What is written is the table's content, headings included: one line per curve, the cells separated by tabs, with no tab after the last cell. A spreadsheet or a script reads it directly. It does not matter which table is in front when you use the command.
The numbers are written with every digit, not as the table rounds them, and with a full stop as the decimal mark whatever the computer's language settings. Where the fit estimated an uncertainty, it gets a column of its own beside its value, headed with the parameter's name and "error".
The dialog, Select File to Save Data, offers text files. A name typed with no extension gets .txt; one typed with an extension keeps it. If the file exists, Fit asks whether to overwrite it: Yes overwrites, No lets you choose another name, and Cancel writes nothing. An empty name asks whether to choose again.
The command is greyed out while the Curve Attributes table is empty.
Limitations
- Fit cannot open an exported file again, and exporting does not count as saving the project.
See also: Export Summary Table · Save Project
Export Summary Table
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Export > Summary Table writes the Summary table - data, model and difference point by point - to a tab-separated text file.
The Summary table has, for every point inside every fit interval, the argument, the measured value, the model's value, the difference and each curve's contribution, with a heading row for each interval. A curve that covers only part of an interval leaves the rest of its column blank.
The file is written exactly as for File > Export > Curve Parameters: headings included, every digit of each number, a full stop as the decimal mark, cells separated by tabs, .txt added to a name with no extension, and the same questions about an existing file or an empty name.
The command is greyed out while the Summary table is empty.
Limitations
- Fit cannot open the file again.
See also: Export Curve Parameters
Quit
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
File > Quit closes Fit, asking first whether to save unsaved work.
It does the same as closing the window. If the project has unsaved changes you are asked whether to save them, and the window stays open if you cancel or the save does not happen.
On closing, Fit writes its settings file: the project that was open, the recent projects and your other preferences.
The compute server is not stopped: it stays running so that the next start is immediate and other windows keep their engine.
The shortcut is Ctrl+Q, on macOS Command+Q.
See also: Unsaved changes · What Fit remembers on this computer · The window and the compute server
Sample data
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
Fit comes with a few data files to try it on, in a folder called Data.
Which files they are depends on the analysis modules this build contains: each module installs examples of its own kind of data, and its chapter of this guide says what each file holds.
Where the folder is: on Windows, beside Fit.exe in the folder Fit was installed to, which is where File > Import Profile starts; on Linux, /usr/share/fit/Data (the package's own name in place of fit for another package); on macOS, in the Resources folder inside the application bundle.
See also: Import Profile · A first fit
Command-line options
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
Fit's window accepts a few options that say what to open at start-up and how much to log.
An option starts with two dashes and takes its value after an equals sign, for example --project=C:\work\sample.fitproj. Put quotes around a path with spaces. A relative path that is not found is tried again relative to the folder Fit is installed in. Fit --help prints the list below, and Fit --version the version.
- --project=<file>: Opens that project. It wins over everything else. If the file is not there, Fit starts with nothing open and says so in the log; it never opens a different project instead.
- --infile=<file>: Starts a new project with that data file imported. It wins over the project remembered from last time.
- --log-level=<level>: How much goes to the log: fatal, warning, notification, debug or trace. The default is debug, which already records almost everything, so this mostly makes the log quieter; trace adds the most repetitive lines as well. An unknown level is reported in the log and the default kept.
- --dpi=<number>: The screen resolution the window is scaled for, in pixels per inch, for a display that does not report it correctly - 192 for a 200 % display.
- --write-params-log: Writes to the log every value assigned to a parameter of a user-defined curve.
- --check-ui: For the program's developers: the window checks its own layout and behaviour, runs a fit, writes the results to the log and closes.
- --help: Prints this list and closes.
- --version: Prints the version and closes.
With neither --project nor --infile, the project open when Fit was last closed is opened again.
The window ignores an argument that is not an option, such as a bare file name. The installed launchers turn a bare file name into --project for a .fitproj file and --infile for any other file, which is how opening a project from the desktop works.
An option the program does not have, one written without the value it needs or with one it does not take, and one given twice are each reported in the log and on the console, all at once. The window still opens; a run nobody watches - the window checking itself, a recording - stops instead, with exit code 2.
The old spelling, /PROJECT=file with the name in capitals, was read for one release and is no longer: it is reported like any other mistake, naming the spelling to write instead.
The compute server, fit_server, has options of its own: --host and --port for where it listens (127.0.0.1 and 8787 by default), --log-level, and --verbose to echo its log to the console.
Limitations
- Arguments starting with a single dash belong to the windowing toolkit (macOS and Qt add their own) and are passed over, as are the LCL debug logger's --debug-log and --debug-enable. On Windows the window has no console, so --help and --version print nothing there; the list is this page.
See also: Log files · Open Recent · The window and the compute server
Log files
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
The window and the compute server each keep a log file, which is where to look when something went wrong.
Both files are in Fit's log folder for the current user, where each system keeps the logs of the programs you run:
- on Windows, %LOCALAPPDATA%\Fit\Logs;
- on macOS, ~/Library/Logs/Fit, which the Console application also lists;
- on Linux, ~/.local/state/fit ($XDG_STATE_HOME replaces ~/.local/state when it is set).
The window writes fit_client.log and the server writes fit_server_log.txt - when the server runs on this computer under your account, which is how the launchers start it - and the Python engine, when a fit uses it, writes fit_sidecar_log.txt beside them.
By default the logs record what you did, what the window asked the server and how long each call took, warnings and errors with the program location where they happened. Some notices go only to the log, among them a remembered project that could not be found at start-up, a data file that has changed since a project was saved, and rows skipped while reading a price file.
A log that reaches 32 MB is renamed with .1 added to its name, replacing the previous .1 file, and a new one is started. So the two most recent files of each log are kept, and nothing older.
The launchers on Linux and macOS also keep what the server prints to its console: on Linux in ~/.local/state/<package>/server.log, on macOS in ~/Library/Logs/<application>/server.log.
Earlier versions kept the logs, together with the settings, in a folder called Fit in your home folder (%APPDATA%\Fit on Windows). The first start of a later version moves both to their own folders and removes the old one once nothing else is left in it. Where every kind of file is now, on each system, is in Where Fit keeps its files.
A copy started by the build script of a source tree writes its logs into the same folder as an installed copy, so each computer has one log folder; the build's Clean empties it.
When you report a problem, attach both log files: each tells one side of the story, and a call can be matched on both sides by its time.
See also: Command-line options · What Fit remembers on this computer · Where Fit keeps its files
What Fit remembers on this computer
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
Choices that belong to you and to this computer rather than to a project are kept in one file, settings.json.
settings.json is in a folder of this computer's own (see Where Fit keeps its files). It is not copied between computers: on Windows it is in the local part of your profile, which does not roam with your account, because much of what it holds - the paths of your projects, the address of a compute server - means nothing on another machine.
The file is JSON, with one section for each part of Fit that keeps something in it:
| Section | What it holds | Written |
|---|---|---|
| app | the compute server's address; the curve type, minimizer, loss function and weighting last chosen; whether Animation Mode is on; how large the report tabs and the Explain pane are drawn; the folder you chose for downloaded data | when the window closes |
| recent | the project open last, which opens by itself at the next start, and the list behind File > Open Recent | as soon as a project is opened or saved |
| preferences | what modules remember, each under keys beginning with its own name, and Fit's own update and notice choices (fit.update-auto, fit.update-feed, fit.acknowledged-notices and the like) | as soon as a choice is made |
| layout | the size and place of the main window, whether it filled the screen, and how much room each of its parts was given; View > Reset Layout empties it | when the window closes |
A section Fit does not know - written by a newer version, or by a module this build does not contain - is kept as it is whenever the file is written, and so is a key it does not know inside a known section. Each part of Fit writes only its own section, reading the file again first, so two windows open at once do not undo each other's changes.
A project carries its own copy of the fit settings, so opening a project sets them as they were when it was saved. The axes are the project's alone and are not in this file.
Versions before this one kept these choices in three files - config.xml, module-preferences.txt and recent-projects.txt. The first start of a version with settings.json carries what they held into it and removes them - those of an installed copy, and those a copy started by the build script kept in var/profile, which win where both say something; one it cannot read is left where it was. Once settings.json exists, an old file found beside it is left alone, because it was written by an older version run since.
A copy started by the build script of a source tree uses the same settings.json as a copy installed on the same computer. When the window checks itself (the --check-ui option), it reads and writes no settings file at all.
Limitations
- If Fit ends without closing its window normally, changes to the app and layout sections since the start of the session are not written; the other two sections were written as they changed.
- A settings.json that cannot be read - cut short, or edited by hand into something that is not JSON - is renamed to settings.json.unreadable, and Fit starts with its defaults.
See also: Where Fit keeps its files · What a project file holds · Open Recent
Where Fit keeps its files
This software's choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.
Fit keeps your settings, your own curve types, its logs and the data it downloads in the folders each system names for them, never in your home folder itself.
For the current user, on each system:
| What | Windows | macOS | Linux | Copy built from source |
|---|---|---|---|---|
| Settings: settings.json | %LOCALAPPDATA%\Fit | ~/Library/Application Support/Fit | ~/.local/state/fit | the same as an installed copy |
| Curve types you defined: *.cpr | %APPDATA%\Fit | ~/Library/Application Support/Fit | ~/.config/fit | the same as an installed copy |
| Logs | %LOCALAPPDATA%\Fit\Logs | ~/Library/Logs/Fit | ~/.local/state/fit | the same as an installed copy |
| Downloaded data | %LOCALAPPDATA%\Fit\downloads | ~/.local/share/fit/downloads | ~/.local/share/fit/downloads | var/profile/data/downloads |
| Python engine, when built from source | %LOCALAPPDATA%\Fit\py | ~/.local/share/fit/py | ~/.local/share/fit/py | the same as an installed copy |
On Linux, $XDG_STATE_HOME, $XDG_CONFIG_HOME and $XDG_DATA_HOME replace ~/.local/state, ~/.config and ~/.local/share when they are set; on macOS $XDG_DATA_HOME replaces ~/.local/share for the downloaded data and the Python engine. The environment variable FIT_PY_HOME names a different folder for the Python engine.
The last column is for a copy started by the build script of a source tree. What its runs produce - logs and downloaded data - is kept inside that tree, so that building and testing leave none of it in your home folder. What you chose and made - the settings and your curve types - is the same for it as for an installed copy: curve types it kept in var/profile before are moved to the one folder when it starts.
The folders are named after the product, so products installed on one computer never read or overwrite one another's settings, curve types, logs or downloads; a product starts with settings of its own and imports none from another.
The settings are kept apart from the logs on purpose: the build's Clean removes the logs and keeps everything else, and a problem report attaches the logs alone.
Limitations
- On macOS the downloaded data and the Python engine are under ~/.local/share rather than ~/Library: that is where every version so far has put them, and moving them would strand the Python environments already set up.
See also: What Fit remembers on this computer · Log files · Open Recent