react-cheminfo 0.131.0 → 0.132.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +29 -0
  2. package/lib/core.d.ts +1 -0
  3. package/lib/core.d.ts.map +1 -1
  4. package/lib/core.js +1 -0
  5. package/lib/core.js.map +1 -1
  6. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  7. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  8. package/lib/locales/de.json +4 -0
  9. package/lib/locales/en.json +4 -0
  10. package/lib/locales/es.json +4 -0
  11. package/lib/locales/fr.json +4 -0
  12. package/lib/locales/it.json +4 -0
  13. package/lib/log/core/index.d.ts +4 -0
  14. package/lib/log/core/index.d.ts.map +1 -0
  15. package/lib/log/core/index.js +3 -0
  16. package/lib/log/core/index.js.map +1 -0
  17. package/lib/log/core/logGroups.d.ts +87 -0
  18. package/lib/log/core/logGroups.d.ts.map +1 -0
  19. package/lib/log/core/logGroups.js +85 -0
  20. package/lib/log/core/logGroups.js.map +1 -0
  21. package/lib/log/core/logLines.d.ts +19 -0
  22. package/lib/log/core/logLines.d.ts.map +1 -0
  23. package/lib/log/core/logLines.js +36 -0
  24. package/lib/log/core/logLines.js.map +1 -0
  25. package/lib/log/ui/LogBadge.d.ts +39 -0
  26. package/lib/log/ui/LogBadge.d.ts.map +1 -0
  27. package/lib/log/ui/LogBadge.js +28 -0
  28. package/lib/log/ui/LogBadge.js.map +1 -0
  29. package/lib/log/ui/LogCallouts.d.ts +55 -0
  30. package/lib/log/ui/LogCallouts.d.ts.map +1 -0
  31. package/lib/log/ui/LogCallouts.js +38 -0
  32. package/lib/log/ui/LogCallouts.js.map +1 -0
  33. package/lib/log/ui/index.d.ts +7 -0
  34. package/lib/log/ui/index.d.ts.map +1 -0
  35. package/lib/log/ui/index.js +5 -0
  36. package/lib/log/ui/index.js.map +1 -0
  37. package/lib/log/ui/logIcon.d.ts +9 -0
  38. package/lib/log/ui/logIcon.d.ts.map +1 -0
  39. package/lib/log/ui/logIcon.js +17 -0
  40. package/lib/log/ui/logIcon.js.map +1 -0
  41. package/lib/log/ui/useLogEntries.d.ts +15 -0
  42. package/lib/log/ui/useLogEntries.d.ts.map +1 -0
  43. package/lib/log/ui/useLogEntries.js +47 -0
  44. package/lib/log/ui/useLogEntries.js.map +1 -0
  45. package/lib/structure/core/conformerMinimise.d.ts +13 -4
  46. package/lib/structure/core/conformerMinimise.d.ts.map +1 -1
  47. package/lib/structure/core/conformerMinimise.js +23 -6
  48. package/lib/structure/core/conformerMinimise.js.map +1 -1
  49. package/lib/structure/core/conformerRefine.d.ts +2 -2
  50. package/lib/structure/core/conformerRefine.d.ts.map +1 -1
  51. package/lib/structure/core/conformerRefine.js +23 -7
  52. package/lib/structure/core/conformerRefine.js.map +1 -1
  53. package/lib/structure/core/conformers.d.ts +8 -3
  54. package/lib/structure/core/conformers.d.ts.map +1 -1
  55. package/lib/structure/core/conformers.js +10 -7
  56. package/lib/structure/core/conformers.js.map +1 -1
  57. package/lib/structure/core/geometryRelaxer.d.ts +10 -3
  58. package/lib/structure/core/geometryRelaxer.d.ts.map +1 -1
  59. package/lib/structure/core/relaxerLogLines.d.ts +16 -0
  60. package/lib/structure/core/relaxerLogLines.d.ts.map +1 -0
  61. package/lib/structure/core/relaxerLogLines.js +33 -0
  62. package/lib/structure/core/relaxerLogLines.js.map +1 -0
  63. package/lib/ui.d.ts +1 -0
  64. package/lib/ui.d.ts.map +1 -1
  65. package/lib/ui.js +1 -0
  66. package/lib/ui.js.map +1 -1
  67. package/lib/xtb/core/taggedLogger.d.ts +11 -0
  68. package/lib/xtb/core/taggedLogger.d.ts.map +1 -0
  69. package/lib/xtb/core/taggedLogger.js +31 -0
  70. package/lib/xtb/core/taggedLogger.js.map +1 -0
  71. package/lib/xtb/core/xtbRelaxer.d.ts.map +1 -1
  72. package/lib/xtb/core/xtbRelaxer.js +13 -5
  73. package/lib/xtb/core/xtbRelaxer.js.map +1 -1
  74. package/package.json +4 -3
  75. package/src/core.ts +1 -0
  76. package/src/locales/de.json +4 -0
  77. package/src/locales/en.json +4 -0
  78. package/src/locales/es.json +4 -0
  79. package/src/locales/fr.json +4 -0
  80. package/src/locales/it.json +4 -0
  81. package/src/log/core/index.ts +9 -0
  82. package/src/log/core/logGroups.ts +159 -0
  83. package/src/log/core/logLines.ts +44 -0
  84. package/src/log/ui/LogBadge.tsx +89 -0
  85. package/src/log/ui/LogCallouts.tsx +103 -0
  86. package/src/log/ui/index.ts +6 -0
  87. package/src/log/ui/logIcon.ts +21 -0
  88. package/src/log/ui/useLogEntries.ts +57 -0
  89. package/src/structure/core/conformerMinimise.ts +34 -8
  90. package/src/structure/core/conformerRefine.ts +29 -13
  91. package/src/structure/core/conformers.ts +23 -12
  92. package/src/structure/core/geometryRelaxer.ts +11 -3
  93. package/src/structure/core/relaxerLogLines.ts +39 -0
  94. package/src/ui.ts +1 -0
  95. package/src/xtb/core/taggedLogger.ts +35 -0
  96. package/src/xtb/core/xtbRelaxer.ts +15 -5
  97. package/styles/chrome.css +34 -0
@@ -0,0 +1,39 @@
1
+ import type { PopoverNextProps } from '@blueprintjs/core';
2
+ import type { ReactElement } from 'react';
3
+ import type { LogLevelLabel, LogLine } from '../core/logGroups.ts';
4
+ /** Props of {@link LogBadge}. */
5
+ export interface LogBadgeProps {
6
+ /** What one or more loggers collected, in the order they logged it. */
7
+ entries: readonly LogLine[];
8
+ /**
9
+ * The least serious level shown.
10
+ * @default 'info'
11
+ */
12
+ minLevel?: LogLevelLabel;
13
+ /**
14
+ * How many messages the popover shows before the rest are counted instead.
15
+ * @default every message
16
+ */
17
+ limit?: number;
18
+ /**
19
+ * Which side the messages open on.
20
+ * @default 'bottom-start'
21
+ */
22
+ placement?: PopoverNextProps['placement'];
23
+ /**
24
+ * Class names added to the button.
25
+ * @default undefined
26
+ */
27
+ className?: string;
28
+ }
29
+ /**
30
+ * One small button standing for every message a logger collected about what
31
+ * sits beside it, drawn in the colour of the most serious and counting them,
32
+ * which opens them all as callouts on hover. The messages stay one pointer
33
+ * away from the chart or the result they qualify instead of pushing it down
34
+ * the page.
35
+ * @param props - See {@link LogBadgeProps}.
36
+ * @returns The button, or nothing when there is no message to show.
37
+ */
38
+ export declare function LogBadge(props: LogBadgeProps): ReactElement | null;
39
+ //# sourceMappingURL=LogBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogBadge.d.ts","sourceRoot":"","sources":["../../../src/log/ui/LogBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAUnE,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,GAAG,IAAI,CAqClE"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button, PopoverNext } from '@blueprintjs/core';
3
+ import { useChromeT } from "../../i18n/ui/useT.js";
4
+ import { joinClassNames } from "../../shared/ui/joinClassNames.js";
5
+ import { groupLogEntries, logIntent, worstLogLevel, } from "../core/logGroups.js";
6
+ import { LogGroupList } from "./LogCallouts.js";
7
+ import { logIcon } from "./logIcon.js";
8
+ /**
9
+ * One small button standing for every message a logger collected about what
10
+ * sits beside it, drawn in the colour of the most serious and counting them,
11
+ * which opens them all as callouts on hover. The messages stay one pointer
12
+ * away from the chart or the result they qualify instead of pushing it down
13
+ * the page.
14
+ * @param props - See {@link LogBadgeProps}.
15
+ * @returns The button, or nothing when there is no message to show.
16
+ */
17
+ export function LogBadge(props) {
18
+ const { entries, minLevel, limit, placement = 'bottom-start', className, } = props;
19
+ const t = useChromeT();
20
+ const groups = groupLogEntries(entries, { minLevel });
21
+ const worst = worstLogLevel(groups);
22
+ if (worst === null)
23
+ return null;
24
+ return (_jsx(PopoverNext, { interactionKind: "hover", hoverOpenDelay: 150, placement: placement, popoverClassName: "log-badge__popover", content: _jsx(LogGroupList, { groups: groups, limit: limit }), children: _jsx(Button, { variant: "minimal", size: "small", intent: logIntent(worst), icon: logIcon(worst), className: joinClassNames('log-badge', 'no-print', className), "aria-label": groups.length === 1
25
+ ? t('log.badge.one')
26
+ : t('log.badge.other', { count: groups.length }), children: groups.length > 1 ? groups.length : undefined }) }));
27
+ }
28
+ //# sourceMappingURL=LogBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogBadge.js","sourceRoot":"","sources":["../../../src/log/ui/LogBadge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EACL,eAAe,EACf,SAAS,EACT,aAAa,GACd,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA4BvC;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EACJ,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAS,GAAG,cAAc,EAC1B,SAAS,GACV,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,OAAO,CACL,KAAC,WAAW,IACV,eAAe,EAAC,OAAO,EACvB,cAAc,EAAE,GAAG,EACnB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAC,oBAAoB,EACrC,OAAO,EAAE,KAAC,YAAY,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAI,YAEvD,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,EACxB,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,EACpB,SAAS,EAAE,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,CAAC,gBAE3D,MAAM,CAAC,MAAM,KAAK,CAAC;gBACjB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;gBACpB,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,YAGnD,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,GACvC,GACG,CACf,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { LogGroup, LogLevelLabel, LogLine } from '../core/logGroups.ts';
3
+ /** Props of {@link LogCallouts}. */
4
+ export interface LogCalloutsProps {
5
+ /** What one or more loggers collected, in the order they logged it. */
6
+ entries: readonly LogLine[];
7
+ /**
8
+ * The least serious level shown.
9
+ * @default 'info'
10
+ */
11
+ minLevel?: LogLevelLabel;
12
+ /**
13
+ * How many messages are shown before the rest are counted instead.
14
+ * @default every message
15
+ */
16
+ limit?: number;
17
+ /**
18
+ * Class names added to the list.
19
+ * @default undefined
20
+ */
21
+ className?: string;
22
+ }
23
+ /**
24
+ * What a logger collected, as callouts in the page: one per distinct message,
25
+ * the most serious first, each in the colour and with the icon of its level.
26
+ *
27
+ * A message is authored prose — `` `code` ``, `{{CO2}}`, `**strong**`. A string
28
+ * `title` in its meta heads it and a string `source` labels where it comes
29
+ * from. A message said several times is shown once, with how many times.
30
+ * @param props - See {@link LogCalloutsProps}.
31
+ * @returns The callouts, or nothing when there is no message to show.
32
+ */
33
+ export declare function LogCallouts(props: LogCalloutsProps): ReactElement | null;
34
+ /** Props of {@link LogGroupList}. */
35
+ export interface LogGroupListProps {
36
+ /** The messages, as {@link groupLogEntries} ordered them. */
37
+ groups: readonly LogGroup[];
38
+ /**
39
+ * How many messages are shown before the rest are counted instead.
40
+ * @default every message
41
+ */
42
+ limit?: number;
43
+ /**
44
+ * Class names added to the list.
45
+ * @default undefined
46
+ */
47
+ className?: string;
48
+ }
49
+ /**
50
+ * Messages already grouped, as callouts.
51
+ * @param props - See {@link LogGroupListProps}.
52
+ * @returns The callouts.
53
+ */
54
+ export declare function LogGroupList(props: LogGroupListProps): ReactElement;
55
+ //# sourceMappingURL=LogCallouts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogCallouts.d.ts","sourceRoot":"","sources":["../../../src/log/ui/LogCallouts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK7E,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,GAAG,IAAI,CAKxE;AAED,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAgCnE"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Callout } from '@blueprintjs/core';
3
+ import { useChromeT } from "../../i18n/ui/useT.js";
4
+ import { InlineText } from "../../pedagogy/ui/InlineText.js";
5
+ import { joinClassNames } from "../../shared/ui/joinClassNames.js";
6
+ import { groupLogEntries, logIntent } from "../core/logGroups.js";
7
+ import { logIcon } from "./logIcon.js";
8
+ /**
9
+ * What a logger collected, as callouts in the page: one per distinct message,
10
+ * the most serious first, each in the colour and with the icon of its level.
11
+ *
12
+ * A message is authored prose — `` `code` ``, `{{CO2}}`, `**strong**`. A string
13
+ * `title` in its meta heads it and a string `source` labels where it comes
14
+ * from. A message said several times is shown once, with how many times.
15
+ * @param props - See {@link LogCalloutsProps}.
16
+ * @returns The callouts, or nothing when there is no message to show.
17
+ */
18
+ export function LogCallouts(props) {
19
+ const { entries, minLevel, limit, className } = props;
20
+ const groups = groupLogEntries(entries, { minLevel });
21
+ if (groups.length === 0)
22
+ return null;
23
+ return _jsx(LogGroupList, { groups: groups, limit: limit, className: className });
24
+ }
25
+ /**
26
+ * Messages already grouped, as callouts.
27
+ * @param props - See {@link LogGroupListProps}.
28
+ * @returns The callouts.
29
+ */
30
+ export function LogGroupList(props) {
31
+ const { groups, limit = groups.length, className } = props;
32
+ const t = useChromeT();
33
+ const hidden = Math.max(0, groups.length - limit);
34
+ return (_jsxs("div", { className: joinClassNames('log-callouts', className), children: [groups.slice(0, limit).map((group) => (_jsxs(Callout, { compact: true, intent: logIntent(group.level), icon: logIcon(group.level), title: group.title, children: [group.source !== undefined && (_jsx("span", { className: "log-callouts__source", children: group.source })), _jsx(InlineText, { text: group.text }), group.count > 1 && (_jsxs("span", { className: "log-callouts__count", children: ["\u00D7", group.count] }))] }, group.key))), hidden > 0 && (_jsx("span", { className: "log-callouts__more", children: hidden === 1
35
+ ? t('log.more.one')
36
+ : t('log.more.other', { count: hidden }) }))] }));
37
+ }
38
+ //# sourceMappingURL=LogCallouts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogCallouts.js","sourceRoot":"","sources":["../../../src/log/ui/LogCallouts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAkC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuBvC;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACtD,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IA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;oBACnB,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GACrC,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type { LogBadgeProps } from './LogBadge.tsx';
2
+ export { LogBadge } from './LogBadge.tsx';
3
+ export type { LogCalloutsProps, LogGroupListProps } from './LogCallouts.tsx';
4
+ export { LogCallouts, LogGroupList } from './LogCallouts.tsx';
5
+ export { logIcon } from './logIcon.ts';
6
+ export { useLogEntries } from './useLogEntries.ts';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/log/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { LogBadge } from "./LogBadge.js";
2
+ export { LogCallouts, LogGroupList } from "./LogCallouts.js";
3
+ export { logIcon } from "./logIcon.js";
4
+ export { useLogEntries } from "./useLogEntries.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/log/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { IconName } from '@blueprintjs/core';
2
+ import type { LogLevelLabel } from '../core/logGroups.ts';
3
+ /**
4
+ * The icon a message of this level is shown with.
5
+ * @param level - The level it was logged at.
6
+ * @returns A Blueprint icon name.
7
+ */
8
+ export declare function logIcon(level: LogLevelLabel): IconName;
9
+ //# sourceMappingURL=logIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logIcon.d.ts","sourceRoot":"","sources":["../../../src/log/ui/logIcon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,CAEtD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The icon a message of this level is shown with.
3
+ * @param level - The level it was logged at.
4
+ * @returns A Blueprint icon name.
5
+ */
6
+ export function logIcon(level) {
7
+ return ICONS[level];
8
+ }
9
+ const ICONS = {
10
+ trace: 'console',
11
+ debug: 'console',
12
+ info: 'info-sign',
13
+ warn: 'warning-sign',
14
+ error: 'error',
15
+ fatal: 'error',
16
+ };
17
+ //# sourceMappingURL=logIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logIcon.js","sourceRoot":"","sources":["../../../src/log/ui/logIcon.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,KAAoB;IAC1C,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,KAAK,GAAoC;IAC7C,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { FifoLogger, LogEntry } from 'fifo-logger';
2
+ /**
3
+ * What a logger holds, kept up to date as it logs: a page shows the messages
4
+ * of a long run while it is still running, and the list redraws only when
5
+ * something was logged.
6
+ *
7
+ * The logger is named, never read from a context: each result keeps a logger
8
+ * of its own, so a new run replaces its own messages and leaves the others'.
9
+ * react-science's `useFifoLogs` is for the one page-wide logger its
10
+ * `FifoLoggerProvider` holds.
11
+ * @param logger - The logger to read, or nothing while there is none.
12
+ * @returns Its entries, the same array until it logs again.
13
+ */
14
+ export declare function useLogEntries(logger: FifoLogger | null | undefined): readonly LogEntry[];
15
+ //# sourceMappingURL=useLogEntries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLogEntries.d.ts","sourceRoot":"","sources":["../../../src/log/ui/useLogEntries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GACpC,SAAS,QAAQ,EAAE,CAiBrB"}
@@ -0,0 +1,47 @@
1
+ import { useCallback, useSyncExternalStore } from 'react';
2
+ /**
3
+ * What a logger holds, kept up to date as it logs: a page shows the messages
4
+ * of a long run while it is still running, and the list redraws only when
5
+ * something was logged.
6
+ *
7
+ * The logger is named, never read from a context: each result keeps a logger
8
+ * of its own, so a new run replaces its own messages and leaves the others'.
9
+ * react-science's `useFifoLogs` is for the one page-wide logger its
10
+ * `FifoLoggerProvider` holds.
11
+ * @param logger - The logger to read, or nothing while there is none.
12
+ * @returns Its entries, the same array until it logs again.
13
+ */
14
+ export function useLogEntries(logger) {
15
+ const subscribe = useCallback((onChange) => {
16
+ if (logger == null)
17
+ return noSubscription;
18
+ const listener = () => {
19
+ snapshots.delete(logger);
20
+ onChange();
21
+ };
22
+ logger.addEventListener('change', listener);
23
+ return () => {
24
+ logger.removeEventListener('change', listener);
25
+ };
26
+ }, [logger]);
27
+ const read = useCallback(() => snapshotOf(logger), [logger]);
28
+ return useSyncExternalStore(subscribe, read, read);
29
+ }
30
+ // One array per logger until it logs again: `getLogs` builds a new one on every
31
+ // call, and a store has to answer the same value while nothing changed.
32
+ const snapshots = new WeakMap();
33
+ const NO_ENTRIES = [];
34
+ function snapshotOf(logger) {
35
+ if (logger == null)
36
+ return NO_ENTRIES;
37
+ let entries = snapshots.get(logger);
38
+ if (entries === undefined) {
39
+ entries = logger.getLogs({ includeChildren: true });
40
+ snapshots.set(logger, entries);
41
+ }
42
+ return entries;
43
+ }
44
+ function noSubscription() {
45
+ // Nothing was subscribed to.
46
+ }
47
+ //# sourceMappingURL=useLogEntries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLogEntries.js","sourceRoot":"","sources":["../../../src/log/ui/useLogEntries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAqC;IAErC,MAAM,SAAS,GAAG,WAAW,CAC3B,CAAC,QAAoB,EAAE,EAAE;QACvB,IAAI,MAAM,IAAI,IAAI;YAAE,OAAO,cAAc,CAAC;QAC1C,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACzB,QAAQ,EAAE,CAAC;QACb,CAAC,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC5C,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjD,CAAC,CAAC;IACJ,CAAC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IACF,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,oBAAoB,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,gFAAgF;AAChF,wEAAwE;AACxE,MAAM,SAAS,GAAG,IAAI,OAAO,EAAmC,CAAC;AAEjE,MAAM,UAAU,GAAwB,EAAE,CAAC;AAE3C,SAAS,UAAU,CACjB,MAAqC;IAErC,IAAI,MAAM,IAAI,IAAI;QAAE,OAAO,UAAU,CAAC;IACtC,IAAI,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,cAAc;IACrB,6BAA6B;AAC/B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { Molecule } from 'openchemlib';
2
+ import type { LogLine } from '../../log/core/logGroups.ts';
2
3
  import type { ConformerOptions } from './conformerOptions.ts';
3
4
  /**
4
5
  * Relax one conformer in place and return its energy.
@@ -8,15 +9,23 @@ import type { ConformerOptions } from './conformerOptions.ts';
8
9
  * than an exception. A non-zero return code from `minimise()` is *not* a
9
10
  * failure: ethyne returns 2 with a perfect geometry.
10
11
  *
11
- * Warnings count the conformers the generator handed back, kept or not, so one
12
- * number never means two things — a row number would, once one is dropped.
12
+ * A warning names its conformer by the count of conformers the generator
13
+ * handed back, kept or not, so one number never means two things — a row
14
+ * number would, once one is dropped.
13
15
  * @param conformer - The conformer to relax. Mutated.
14
16
  * @param options - Force field and iteration budget.
15
17
  * @param produced - 1-based position of the conformer in the generator's output.
16
- * @param warnings - Receives one sentence when the energy is unknown.
18
+ * @param logs - Receives one warning when the energy is unknown.
17
19
  * @returns Total energy in kcal/mol, or `null` when none was computed.
18
20
  */
19
- export declare function minimiseConformer(conformer: Molecule, options: ConformerOptions, produced: number, warnings: string[]): number | null;
21
+ export declare function minimiseConformer(conformer: Molecule, options: ConformerOptions, produced: number, logs: LogLine[]): number | null;
22
+ /**
23
+ * The label of a conformer as the generator handed it back, which a message
24
+ * about it is shown under.
25
+ * @param produced - 1-based position of the conformer in the generator's output.
26
+ * @returns E.g. `3rd conformer produced`.
27
+ */
28
+ export declare function producedSource(produced: number): string;
20
29
  /** What {@link rankByEnergy} reads and rewrites on a conformer. */
21
30
  export interface RankedConformer {
22
31
  id: number;
@@ -1 +1 @@
1
- {"version":3,"file":"conformerMinimise.d.ts","sourceRoot":"","sources":["../../../src/structure/core/conformerMinimise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,GAAG,IAAI,CAqBf;AAED,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,eAAe,EACpD,UAAU,EAAE,SAAS,CAAC,EAAE,GACvB,CAAC,EAAE,CAKL"}
1
+ {"version":3,"file":"conformerMinimise.d.ts","sourceRoot":"","sources":["../../../src/structure/core/conformerMinimise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EAAE,GACd,MAAM,GAAG,IAAI,CA2Bf;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD;AAUD,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,eAAe,EACpD,UAAU,EAAE,SAAS,CAAC,EAAE,GACvB,CAAC,EAAE,CAKL"}
@@ -8,15 +8,16 @@ import { ordinal } from "../../format/core/words.js";
8
8
  * than an exception. A non-zero return code from `minimise()` is *not* a
9
9
  * failure: ethyne returns 2 with a perfect geometry.
10
10
  *
11
- * Warnings count the conformers the generator handed back, kept or not, so one
12
- * number never means two things — a row number would, once one is dropped.
11
+ * A warning names its conformer by the count of conformers the generator
12
+ * handed back, kept or not, so one number never means two things — a row
13
+ * number would, once one is dropped.
13
14
  * @param conformer - The conformer to relax. Mutated.
14
15
  * @param options - Force field and iteration budget.
15
16
  * @param produced - 1-based position of the conformer in the generator's output.
16
- * @param warnings - Receives one sentence when the energy is unknown.
17
+ * @param logs - Receives one warning when the energy is unknown.
17
18
  * @returns Total energy in kcal/mol, or `null` when none was computed.
18
19
  */
19
- export function minimiseConformer(conformer, options, produced, warnings) {
20
+ export function minimiseConformer(conformer, options, produced, logs) {
20
21
  const algorithm = options.minimisation;
21
22
  if (algorithm === 'none')
22
23
  return null;
@@ -27,15 +28,31 @@ export function minimiseConformer(conformer, options, produced, warnings) {
27
28
  energy = forceField.getTotalEnergy();
28
29
  }
29
30
  catch (error) {
30
- warnings.push(`The ${ordinal(produced)} conformer produced could not be minimised with ${algorithm} (${readable(error)}), so its energy is unknown.`);
31
+ logs.push(producedWarning(produced, `It could not be minimised with ${algorithm} (${readable(error)}), so its energy is unknown.`));
31
32
  return null;
32
33
  }
33
34
  if (!Number.isFinite(energy)) {
34
- warnings.push(`The ${ordinal(produced)} conformer produced minimised to a non-finite ${algorithm} energy, so its energy is unknown.`);
35
+ logs.push(producedWarning(produced, `It minimised to a non-finite ${algorithm} energy, so its energy is unknown.`));
35
36
  return null;
36
37
  }
37
38
  return energy;
38
39
  }
40
+ /**
41
+ * The label of a conformer as the generator handed it back, which a message
42
+ * about it is shown under.
43
+ * @param produced - 1-based position of the conformer in the generator's output.
44
+ * @returns E.g. `3rd conformer produced`.
45
+ */
46
+ export function producedSource(produced) {
47
+ return `${ordinal(produced)} conformer produced`;
48
+ }
49
+ function producedWarning(produced, message) {
50
+ return {
51
+ levelLabel: 'warn',
52
+ message,
53
+ meta: { source: producedSource(produced) },
54
+ };
55
+ }
39
56
  /**
40
57
  * Order a set from the most stable conformer down, number it from one in that
41
58
  * order, and measure every known energy from the lowest.
@@ -1 +1 @@
1
- {"version":3,"file":"conformerMinimise.js","sourceRoot":"","sources":["../../../src/structure/core/conformerMinimise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAIrD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAmB,EACnB,OAAyB,EACzB,QAAgB,EAChB,QAAkB;IAElB,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC;IACvC,IAAI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,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC"}
@@ -47,8 +47,8 @@ export interface ConformerSetRefinement {
47
47
  */
48
48
  reordered: number;
49
49
  }
50
- /** How a refinement pass is tuned, watched and cancelled. */
51
- export interface RefineConformersOptions extends RelaxerOptions {
50
+ /** How a refinement is tuned and watched; what it logs is kept on the set. */
51
+ export interface RefineConformersOptions extends Omit<RelaxerOptions, 'logger'> {
52
52
  /**
53
53
  * Name of the method, for the label the UI shows.
54
54
  * @default 'GFN2-xTB'
@@ -1 +1 @@
1
- {"version":3,"file":"conformerRefine.d.ts","sourceRoot":"","sources":["../../../src/structure/core/conformerRefine.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EACf,MAAM,sBAAsB,CAAC;AAQ9B,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,6DAA6D;AAC7D,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,SAAO,CAAC;AAElD,4EAA4E;AAC5E,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,eAAe,EACtB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,YAAY,CAAC,CAqGvB"}
1
+ {"version":3,"file":"conformerRefine.d.ts","sourceRoot":"","sources":["../../../src/structure/core/conformerRefine.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EACf,MAAM,sBAAsB,CAAC;AAS9B,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,8EAA8E;AAC9E,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CACnD,cAAc,EACd,QAAQ,CACT;IACC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,SAAO,CAAC;AAElD,4EAA4E;AAC5E,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,eAAe,EACtB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,YAAY,CAAC,CA+GvB"}
@@ -1,9 +1,11 @@
1
+ import { FifoLogger } from 'fifo-logger';
1
2
  import { Molecule } from 'openchemlib';
2
3
  import { ordinal } from "../../format/core/words.js";
3
4
  import { isRefinedDuplicate, rankByRefinedEnergy, } from "./conformerRefineRank.js";
4
5
  import { conformerShape } from "./conformerShape.js";
5
6
  import { centredRmsd, readRelaxableGeometry, writeRelaxedCoordinates, } from "./moleculeCoordinates.js";
6
7
  import { toMolfileExport } from "./molfileExport.js";
8
+ import { relaxerLogLines } from "./relaxerLogLines.js";
7
9
  /**
8
10
  * Energy gap in kcal/mol under which two relaxed conformers can be one minimum.
9
11
  *
@@ -62,15 +64,19 @@ export async function refineConformers(set, relax, options = {}) {
62
64
  geometry: readRelaxableGeometry(molecule),
63
65
  });
64
66
  }
67
+ const relaxerLog = new FifoLogger({ level: 'info' });
65
68
  const relaxed = await relax(prepared.map((entry) => entry.geometry), {
66
69
  onSettled: options.onSettled,
67
70
  signal: options.signal,
71
+ logger: relaxerLog,
68
72
  });
69
73
  if (relaxed.length !== set.conformers.length) {
70
74
  throw new Error(`The relaxer answered with ${relaxed.length} geometries for ${set.conformers.length} conformers.`);
71
75
  }
72
76
  const tolerance = options.sameEnergyTolerance ?? REFINED_SAME_ENERGY_TOLERANCE;
73
- const warnings = [...set.warnings];
77
+ const own = [];
78
+ // Each structure's label, `null` for one merged away with its messages.
79
+ const sources = new Array(prepared.length).fill(null);
74
80
  const kept = [];
75
81
  const minima = [];
76
82
  let merged = 0;
@@ -88,11 +94,14 @@ export async function refineConformers(set, relax, options = {}) {
88
94
  merged++;
89
95
  continue;
90
96
  }
91
- for (const warning of result.warnings) {
92
- warnings.push(`The ${ordinal(conformer.id)} conformer: ${warning}`);
93
- }
97
+ const source = `${ordinal(conformer.id)} conformer`;
98
+ sources[index] = source;
94
99
  if (!result.converged) {
95
- warnings.push(`The ${ordinal(conformer.id)} conformer did not reach a ${method} minimum in ${result.cycles} cycles, so its refined energy is an upper bound.`);
100
+ own.push({
101
+ levelLabel: 'warn',
102
+ message: `It did not reach a ${method} minimum in ${result.cycles} cycles, so its refined energy is an upper bound.`,
103
+ meta: { source },
104
+ });
96
105
  }
97
106
  kept.push({
98
107
  ...conformer,
@@ -111,13 +120,20 @@ export async function refineConformers(set, relax, options = {}) {
111
120
  minima.push(candidate);
112
121
  }
113
122
  if (merged > 0) {
114
- warnings.push(`${merged} conformer(s) relaxed into a ${method} minimum the set already held, so they were dropped.`);
123
+ own.push({
124
+ levelLabel: 'info',
125
+ message: `${merged} conformer(s) relaxed into a ${method} minimum the set already held, so they were dropped.`,
126
+ });
115
127
  }
116
128
  const ranked = rankByRefinedEnergy(kept);
117
129
  return {
118
130
  ...set,
119
131
  conformers: ranked.conformers,
120
- warnings,
132
+ logs: [
133
+ ...set.logs,
134
+ ...relaxerLogLines(relaxerLog.getLogs(), sources),
135
+ ...own,
136
+ ],
121
137
  rankedBy: REFINED_RANKING,
122
138
  refinement: {
123
139
  method,
@@ -1 +1 @@
1
- {"version":3,"file":"conformerRefine.js","sourceRoot":"","sources":["../../../src/structure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MAAM,CAAC,gBAAgB;gBACzC,gBAAgB,EAAE,SAAS,CAAC,MAAM;gBAClC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC;gBAC3D,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B;SACF,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,GAAG,CAAC,IAAI,CAAC;YACP,UAAU,EAAE,MAAM;YAClB,OAAO,EAAE,GAAG,MAAM,gCAAgC,MAAM,sDAAsD;SAC/G,CAAC,CAAC;IACL,CAAC;IACD,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO;QACL,GAAG,GAAG;QACN,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,IAAI,EAAE;YACJ,GAAG,GAAG,CAAC,IAAI;YACX,GAAG,eAAe,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC;YACjD,GAAG,GAAG;SACP;QACD,QAAQ,EAAE,eAAe;QACzB,UAAU,EAAE;YACV,MAAM;YACN,mBAAmB,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS;YAClD,MAAM;YACN,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B;KACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { Molecule } from 'openchemlib';
2
+ import type { LogLine } from '../../log/core/logGroups.ts';
2
3
  import type { ConformerOptions, MinimisationAlgorithm } from './conformerOptions.ts';
3
4
  import type { ConformerRefinement, ConformerSetRefinement } from './conformerRefine.ts';
4
5
  import type { MolfileExport } from './molfileExport.ts';
@@ -37,8 +38,12 @@ export interface ConformerSet {
37
38
  stoppedBy: StopReason;
38
39
  /** Wall-clock duration of the run, initialisation and continuations included. */
39
40
  elapsedMilliseconds: number;
40
- /** Plain sentences about conformers that were dropped or left unminimised. */
41
- warnings: string[];
41
+ /**
42
+ * What the run has to say: conformers dropped (`error`), left without an
43
+ * energy (`warn`), merged by a refinement (`info`). Plain, so the set can be
44
+ * posted from a worker and saved in a figure with them.
45
+ */
46
+ logs: LogLine[];
42
47
  /** The force field that was asked for, echoed so a reader knows what the energies mean. */
43
48
  minimisation: MinimisationAlgorithm;
44
49
  /** Conformers the generator handed back, dropped ones included: where a continuation resumes. */
@@ -79,7 +84,7 @@ export type ConformerLimits = Pick<ConformerOptions, 'maxConformers' | 'timeoutS
79
84
  * @param molecule - Structure to embed. Not mutated.
80
85
  * @param options - Strategy, limits, seed and force field.
81
86
  * @param now - Clock used for the time budget, injectable for tests.
82
- * @returns Every conformer kept, most stable first, with relative energies and any warnings.
87
+ * @returns Every conformer kept, most stable first, with relative energies and what the run logged.
83
88
  * @throws {Error} When the structure is empty or OpenChemLib refuses to initialise it.
84
89
  */
85
90
  export declare function generateConformers(molecule: Molecule, options: ConformerOptions, now?: () => number): ConformerSet;
@@ -1 +1 @@
1
- {"version":3,"file":"conformers.d.ts","sourceRoot":"","sources":["../../../src/structure/core/conformers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,4EAA4E;AAC5E,MAAM,WAAW,SAAS;IACxB,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,OAAO,EAAE,aAAa,CAAC;IACvB,6EAA6E;IAC7E,MAAM,EAAE,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