Writing a pack for your laboratory’s words
A pack is a file of words that adds to the Dictionary. For example, a pack
can tell Ingence that noco and nocodazole name the same thing in your laboratory’s file names.
It also says what kind of thing that is. A pack adds words. It doesn’t add rules. This guide shows how to
make a pack, install it, test it and share it.
You need a project to install it into (Add a folder) and a text editor. You do not need to write any code.
When a pack is the right tool
For a word that only one project uses, answer in the Dashboard. Ingence asks what it means and saves your answer in that project’s answer log (Teaching Ingence your words). A pack is for words you want to take with you:
to every project your laboratory makes, so people don’t have to answer the same question twice;
to a colleague, or to another laboratory that names things the way yours does;
to the Ingence project, if the words belong to a whole field, such as microscopy.
A pack cannot settle a word that has two meanings: only an answer can. So if a word means two things in your laboratory, answer it in the Dashboard.
Two ways to start
From what you already taught. If a project holds answers, export them as a pack:
ingence teach export-answers -p PROJECT --out ours.yaml --section hela-bench --author "A. Person" --licence MIT
--section gives the pack its name, hela-bench here. Without it, the name is taught. A second
pack exported the same way would then clash with the first in a project that installs both. The
file lists each word you defined or assigned, with who answered and when. The command leaves out
answers that apply to one folder only, because they name that project’s folders. It says how many
it left out. If the file already exists, the command doesn’t write anything. Add --overwrite to replace
it.
Read every line of the file before you share it. It holds the names of the people who answered. It may also hold words that only your laboratory uses (What never goes in a shared pack).
By hand. Make a file such as this one. The words are real and the bench is invented. On this bench, the technique is a wound healing assay and the drug is nocodazole. The confocal microscope is a Leica SP8.
pack:
name: hela-bench
version: "1"
author: A. Person
licence: MIT
section: hela-bench
theme_kind: technique
summary: The techniques, drugs and microscopes of one invented bench.
entries:
- {term: wound_healing_assay, canonical: wound healing assay,
surfaces: [woundhealing, "wound-healing", woundassay]}
- {term: nocodazole_drug, canonical: nocodazole,
surfaces: [nocodazole, noco], theme_kind: reagent}
- {term: leica_sp8, canonical: Leica SP8 confocal,
surfaces: [sp8, leicasp8], theme_kind: instrument}
What each part says
The pack: block is the pack’s manifest, its description of itself. It sits at the top of the
file so that the pack travels as one file.
nameis what a project calls the pack. It uses lowercase letters, digits,_and-, up to 64 characters. Ingence refuses a name that a shipped pack already uses (microscopy,biochemistryand the others).versionis text. Write it in quotes, because Ingence reads an unquoted1.10as the number 1.1. Raise it when the words change.authorandlicencesay who wrote the pack and under what terms. The field is spelledlicence. Ingence ignores a field spelledlicense, and doesn’t say so. Choose the license with care, because a pack is meant to be shared.schemaanddigestare for a pack thatteach export-answerswrote.schemais the version of the record format the pack was written for, in quotes.digestis a fingerprint of the pack’s words, so that Ingence can tell a damaged or edited pack. Leave both out of a pack you write by hand. Ingence checks each one only if the pack has it.
Below the block the file follows the shape the shipped words use.
sectionnames the group of words. It also names the pack where a file doesn’t have apack:block. A pack exported withteach export-answerstakes it from--section.summarysays in one line what the words are. The Dictionary section, in Advanced, shows it.theme_kindis the kind of thing the words are, as a default for every entry. Kinds includetechnique,reagent,instrument,software,formatandmeasurement. An entry can name its own kind, asnocodazole_drugdoes. Use a kind the shipped words already use, where one fits. The Dictionary reference lists them with their words.entriesis the list of words. Each entry has aterm, which names the meaning, and itssurfaces, the spellings that carry it. It can also have acanonical, the name shown to people.
Spellings are text, written in a list in brackets. Capitals do not matter, and a hyphen or an
underscore inside a spelling does not stop it matching. List the spellings people really write: the
short form, the long form and the form with a hyphen. A spelling can be a phrase of several words,
such as "leica sp8". It matches those words with spaces or with underscores between them. Put
quotation marks around a spelling that holds punctuation ("wound-healing") or a space, or that
looks like a number ("2"). Ingence refuses a bare word where a list belongs, or a number where a
spelling belongs. Its message names the entry.
A few optional fields exist for words with special behavior. For example, extension_only marks a
spelling that counts only as a file ending. The shipped packs use these fields. Read the
microscopy pack before you use one.
A pack can also be a folder. It holds a pack.yaml with the name, version and summary, beside one
or more section files. Use a folder when the words are long enough to split across files.
Install it, test it, remove it
ingence teach pack install ours.yaml -p PROJECT
ingence teach pack list -p PROJECT
ingence teach pack remove NAME -p PROJECT
install reads the whole pack first. If it cannot load the pack, it refuses it and says why, for
example:
a spelling list that is not a list;
a name already taken;
a pack that needs a newer Ingence;
words that do not match their digest.
Ingence doesn’t install any part of a refused pack. Otherwise install says how many spellings your pack and
the shipped words both claim and now tie on, if any.
install copies the pack into the project, so install it into every project that should read it.
list shows each installed pack, its version, a short fingerprint, and whether a scan loads it.
remove deletes the project’s copy, and never changes the file you installed from. To install a
changed pack under the same name, remove the old one first.
Ingence reads a pack from the next scan. In the Dashboard, press Re-run. By hand, run
ingence index --rebind -p PROJECT and then ingence infer -p PROJECT. A project that has never
listed its files doesn’t have anything to read again, so run ingence index -p PROJECT instead.
To test your words, try the pack on a small folder of your own with the same kind of names. Or copy the practice folder from The command line and add a file named for one of your words. Then:
ingence teach vocabulary -p PROJECT
ingence teach collisions -p PROJECT
In the vocabulary list, your words show pack in the origin column. collisions lists each
spelling that has more than one meaning, with the ties your pack made. It also lists the spellings
that an answer of yours settled.
When a pack and the shipped words disagree
Two meanings can claim one spelling. The shipped words include the words every laboratory uses, so this happens whenever a pack uses a common word.
Your answer always wins. An answer wins over every pack and over the shipped words. This holds for an answer given in the Dashboard or imported into the answer log.
A pack stands level with the shipped words. Where both claim one spelling, Ingence reports a tie. It names both meanings, doesn’t give a result on that word, and asks you.
installsays how many spellings became ties.
So a common word in your pack can change what a project reads. A word Ingence read before
becomes a tie. A rule that needs it then doesn’t give a result until
you answer. After you install, run
ingence teach collisions -p PROJECT and read the list. If a spelling is there that you did not
mean to claim, take it out of your pack. Where two packs of your own claim one spelling, they are
level too, and the word is a tie.