Skip to content

Commit c6d7071

Browse files
committed
UPD todos
1 parent cae51c6 commit c6d7071

File tree

2 files changed

+47
-228
lines changed

2 files changed

+47
-228
lines changed

Diff for: TODO.org

+47-103
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@ Draft or long-running issues, WIP, triage, and additional references or context
55

66
* TODO SCIMODOM DRAFT ISSUES
77

8-
** TODO MAINTENANCE [1/2]
8+
** TODO MAINTENANCE [0/1]
99

1010
- [ ] ~pre-commit run --all-files~ under server (.pre-commit-config.yaml) runs for all files incl. client.
11-
- [X] Add *CrossMap* to requirements.
1211

13-
** TODO STYLE [1/20]
12+
** TODO STYLE [1/22]
1413

1514
- [ ] DEADLINE: <2024-09-30 Mon> To harmonize style across views, components, and presets (colours, behaviour, dark mode, /etc./).
1615

1716
- [ ] CascadeSelect :: /cf./ [[https://github.com/dieterich-lab/scimodom/issues/103][Cascade truncated.]]
1817
- [ ] CascadeSelect :: "No available options" is not defined, /cf./ TreeSelect or Dropdown. Styling is different.
19-
- [ ] In ~ProjectMetadata,vue~, some placeholders are grey, others are black/darker (resp. ligher in dark mode).
18+
- [ ] In ~ProjectMetadata,vue~, some placeholders are grey, others are black/darker (resp. lighter in dark mode).
2019
- [ ] Dark mode (specific issues)
2120
- [ ] Logos are displayed in greyscale in dark mode, as invert also inverts the colors. Otherwise, we may have to use 2 logos,
2221
or create SVGs.
23-
- [ ] ~DataTable~: ~stripedRows~ removed, it doesn't work well with dark mode. Modify the preset?
22+
- [ ] ~DataTable~: ~stripedRows~ for dark mode.
2423
- [ ] URGENT :: ~VirtualScroll~ not working, see [[https://github.com/primefaces/primevue-tailwind/issues/108][Missing preset for VirtualScroller]] and [[https://github.com/primefaces/primevue-tailwind/issues/168][VirtualScroller not working with DataTabe.]]
2524
- [ ] Placeholder text color ~TreeSelect~ /vs./ ~MultiSelect~.
2625
- [ ] Default preset color is secondary for ~DataTable~, ~Paginator~, and ~tabView~. Why not use a local ~ptOptions~
@@ -45,114 +44,59 @@ Draft or long-running issues, WIP, triage, and additional references or context
4544
- [ ] Form validation and warnings/messages styling/text for login/sign up/reset components.
4645
- [ ] Large numbers don't show nicely in the Search paginator.
4746
- [ ] Outdated presets for Lara. Remove?
47+
- [ ] Add MeterGroup or ProgessBar for upload? See also [[https://github.com/dieterich-lab/scimodom/issues/94][Dataset upload progress]].
4848

49-
** TODO PEP [1/8]
49+
** TODO PEP/TYPING [0/3]
5050

51-
- Note taken on [2024-02-03 Sat 07:51] \\
52-
Check [[https://github.com/dieterich-lab/scimodom/issues/28][Add type hints, docstrings]], there are some long-term impovements. See [[https://docs.sqlalchemy.org/en/20/orm/extensions/mypy.html][Mypy / Pep-484 Support for ORM Mappings]] for SQLAlchemy-related, also [[https://realpython.com/python-type-checking/][type checking]] in general. \\
53-
Mypy to pre-commit, check examples https://lyz-code.github.io/blue-book/devops/mypy/, https://pre-commit.com/hooks.html, https://github.com/pre-commit/mirrors-mypy, https://jaredkhan.com/blog/mypy-pre-commit. \\
54-
Other resources that I found useful: https://adamj.eu/tech/2021/06/14/python-type-hints-3-somewhat-unexpected-uses-of-typing-any-in-pythons-standard-library/, https://quantlane.com/blog/type-checking-large-codebase/, https://docs.joshuatz.com/cheatsheets/python/types/.
55-
56-
- [ ] [2024-02-03 Sat]
57-
[[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/src/scimodom/utils/operations.py::import pybedtools # type: ignore]]
58-
- [ ] [2024-02-03 Sat] Uncomment and fix errors.
59-
[[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/pyproject.toml::strict = "True"]]
60-
- [ ] [2024-02-03 Sat] ~# type: ignore~ top level does not work for scimodom.api.models. I don't know how to handle these. File excluded in pyproject.toml.
51+
- [ ] [2024-02-03 Fri] Uncomment [[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/pyproject.toml::strict = "True"]]
52+
and fix errors, add missing stubs for flask-cors, requests, /etc./
53+
- [ ] [2024-08-21 Wed] [[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/src/scimodom/services/bedtools.py::"import pybedtools"]]
54+
- [ ] [2024-02-03 Fir] ~# type: ignore~ top level does not work for scimodom.api.models. File excluded:
6155
[[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/pyproject.toml::"scimodom.utils.models.py"]]
62-
- [ ] [2024-02-03 Sat]
63-
[[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/src/scimodom/services/annotation.py::import requests # type: ignore]]
64-
- [ ] Check [[https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html#migrating-an-existing-mapping][Migrating an Existing Mapping]], go beyond step 3, although typing is supported from step 3 onwards:
65-
Step one - declarative_base() is superseded by DeclarativeBase
66-
Step two - replace Declarative use of Column with mapped_column()
67-
Step three - apply exact Python types as needed using Mapped.
68-
Step four - remove mapped_column() directives where no longer needed
69-
Step five - make use of pep-593 Annotated to package common directives into types
70-
- [ ] In setup, we use pandas. Type check is disabled. The problem is that there is in fact no type casting, tables are read and values
71-
are bulk upserted.
72-
- [ ] Harmonize docstrings /e.g./ ~str~ /vs./ ~String~ /etc./. Order of arguments. Add ~Raises~. Add docstrings where missing.
73-
- [X] [2024-02-03 Sat] [[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/src/scimodom/api/__init__.py::E402 module level import not at top of file]]
74-
75-
** TODO GENERAL [20/35]
76-
77-
- [ ] download :: Download view temporarily removed, this feature is relegated. Do we want selective/schema DB dumps? Do we want
78-
to allow ~Export~ to export "all" selected records, not only those lazy loaded and shown on the screen (~SearchView.vue~)? See
79-
also [[https://github.com/dieterich-lab/scimodom/issues/62][Search view data export]]
80-
81-
- [ ] dependencies :: replace pandas in ~SetupService~.
82-
83-
- [X] refactor :: Move ~upsert.py~. Call at startup.
84-
- [ ] refactor :: Can we add type casting methods directly in each ORM model class?
85-
- [ ] refactor :: ~getUserName~ in ~headerLayout~ to store getter.
86-
87-
- [X] models :: Add ~Dataset~ contact and/or date added?
88-
- [X] models :: ~assembly_id: Mapped[int] = mapped_column(ForeignKey("assembly.id"))~ in ~Dataset~ (and relationships) is redundant,
89-
we don't need to know the assembly, as there is only one in the DB!
90-
- [X] models :: RNA type nomenclature enforcement. /Partly implemented, see [[https://github.com/dieterich-lab/scimodom/issues/97][RNA types]] for the rest/.
91-
92-
- [X] import :: [2024-02-16 Fri] Add exception if /e.g./ more than 30% of features are unmapped.
93-
[[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/src/scimodom/services/assembly.py::Unmapped features are discarded.]]
94-
- [X] import :: What happens if /e.g./ too many rows are skipped or in the worst case there is no records (/e.g./ if chroms are
95-
not formatted short/Ensembl-style)? Maybe we should have a "no commit" fallback and warning/error. See /e.g./ during testing upload
96-
with mock data: ~WARNING scimodom.services.annotation.annotate_data.193 | No records found for Kr6uj7QzWfLJ...~.
97-
- [X] import :: ~_validate_columns~ (EUFHeaderImporter) adjusted to check first /non-comment/ row, and raises a ~SpecsError~ if the column
98-
count does not match (or if emtpy). On the other hand, EUFDataImporter ignore bad rows. Maybe it would make more sense to NOT
99-
validate the column count in EUFHEaderImporter, leave it to EUFDataImporter to handle it, and add a test to check how
100-
many rows were skipped (/e.g./ if a file has chrom long format style, it will be skipped entirely), or if the file was empty,
101-
before writing to the database.
102-
- [X] import :: Buffer by chunk (no flush)?
103-
- [ ] import :: Title is ~VARCHAR(255)~ (dataset/project) but there is no check on project/dataset creation (batch or dataset).
104-
For the FE forms, add a max. length/validation.
105-
106-
- [ ] test :: [2024-02-18 Sun] [[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/tests/unit/conftest.py::def data_path(tmp_path_factory, monkeypatch):]]
107-
I see no other choice than using ~scope=sesion~, with either *pytest-dotenv* or setting a global env (=pyproject.toml=) for all tests, and
108-
using a single directory. What I would like to is to use ~monkeypatch.setenv~ to /dynamically/ set ~DATA_PATH~ to ~loc~ (tmp directory for test),
109-
to isolate each test, but calling ~AssemblyService~ or ~AnnotationService~ overrides ~DATA_PATH~, as this loads the config, which in turn
110-
loads the dotenv file.
111-
- [ ] test :: Integration tests?
112-
113-
- [ ] search :: Features and biotypes are fixed, but /e.g./ do biotypes change with organism?
114-
- [X] search :: Export: (1) add additional columns /e.g./ taxa_id, cto, RNA type, /etc./ that are hidden from the table, but that requires adding these
115-
to the select query, we need to see if that impacts performance; if not, then (2) add a header with at least modification, taxa_id, and cto; if not
116-
then (3) format filename (this is the current solution).
117-
- [X] browse :: Additional information for the ~Dialog~ or for the export? /e.g./ ~sequencing_platform~, ~basecalling~, ~bioinformatics_workflow~,
118-
~experiment~, and/or ~ProjectContact~ (~Project~ or eventually ~Dataset~ contact).
119-
- [ ] browse :: Maybe the project ~added_date~ is not needed?
120-
- [ ] project :: When adding more than 1 metadata sheet, assembly is reset, also resetting the model. This is not critical,
121-
since we ask user to write the assembly as input, but would be nice to sort.
122-
123-
- [X] router :: All routes to ~/~ with backward/forward navigation? This does not allow either to open a link in a new tab. Also how would
124-
that work with route guards, secure routes, /etc./? Finally, with route params (/e.g./ ~Browse~, where EUFID is directly added to the index),
125-
this sounds like a strange choice... For ~Browse~ in particular, when clicking on EUFID in ~Search~, we want a new tab, to avoid loosing
126-
the current search results. /Moved to an issue, see [[https://github.com/dieterich-lab/scimodom/issues/16][Set-up routing configuration]]/.
12756

128-
- [ ] store :: Import/use pinia before router. Options /vs./ Composition. Add pinia as argument to router ~beforeEach~. Check =ways-to-use-pinia=.
57+
** TODO TESTS [0/9]
12958

130-
- [ ] forms :: Add lazy validation to form fields, in particular for login/sign up? Check also strict, see https://github.com/jquense/yup
131-
- [ ] forms :: Do not load the full ~yup~ package, but only what is needed. Customize validation (login /vs./ sign up). Revisit messages. See
132-
/e.g./ https://tailwind.primevue.org/inputtext/#helptext. Classes are wrong, there is no ~p-error~, /etc./
59+
- [ ] warnings :: freezgun, pydantic
60+
61+
- [ ] refactor :: Use tests/fixtures throughout wherever possible. Some tests may still contain redundant locally defined fixtures.
62+
~conftest.py::data_path~ is only used by ~test_import_data~, this should be simplified /cf./ ~tool.pytest.ini_options~.
63+
- [ ] refactor :: ~test_ensembl~ subject to [[https://github.com/dieterich-lab/scimodom/issues/119][Annotation services]]. Currently it is not possible to fully isolate these tests.
64+
65+
- [ ] missing :: ~test_dataset~ does not test ~DatasetImportError~, ~SelectionNotFoundError~, ~DatasetExistsError~.
66+
- [ ] missing :: Integration tests.
67+
- [ ] missing :: Missing models in ~test_bedtools_dto~, ~test_project_dto~, /etc./
68+
- [ ] missing :: ~test_bedtools~ has limited scope, some protected methods are not tested (isolation?). Everything
69+
that touches annotation is not really tested (see related tests if testing could be reasonnably divided/isolated).
13370

134-
- [X] email :: Env vars (SMTP, /etc./) probably need to go to the =docker-compose.yml= for production, /etc./? Also do we have twice the same
135-
env var for PUBLIC SERVER?
71+
- [ ] EUFID length is not validated? See /e.g./ dataset fixture. Same for random SMIDs...
72+
- [ ] I've noticed in some cases that adding rows to models with FK constraints succeeds even when the FK does
73+
not exists, /e.g./ ~association_id~. This should be investigated, otherwise this "invalidates" a test!
13674

137-
- [ ] operations/specs :: Does bedtools support strand ~.~? Constraints to Data model in import?
75+
** TODO GENERAL [0/9]
13876

139-
- [X] docs :: Only Ensembl short format for chrom, they will be ignored.
140-
- [X] docs :: bedRMod = 1 organism (incl. cell type/tissue), 1 technology, 1 RNA type (mRNA, tRNA, /etc./), but 1+ modification (name field).
141-
- [ ] docs :: Only GTF format (annotation).
142-
- [X] docs :: The header in bedRMod and selection must match exactly /e.g./ GRCh38 and hg38 will throw an exception.
143-
- [X] docs :: Flask CLI.
144-
- [ ] docs :: Dataset/project title length (json template or project creation form).
77+
- [ ] dependencies :: Pandas is used only in ~SetupService~.
14578

146-
- [ ] [2024-02-22 Thu] [[file:~/prj/RMapDFGTRR319/repositories/scimodom/server/src/scimodom/plugins/cli.py::session.rollback()]]
147-
Session does not rollback. Why? Does this also happens somewhere else?
148-
- [X] How to consistently and robustly handle suspected discrepancies at upload (form fields vs. header,
149-
form fields vs. data records) to avoid DB transactions?
79+
- [ ] refactor :: ~FileService~ "mixes" *os* and *pathlib*, and this also causes a number of typing errors; and there are some
80+
methods that should be protected that are not. The "chain file constructor" should go to ~FileService~. Also now
81+
the ~AssemblyFileType~ is problematic (type warnings). This should be addressed with refactoring of [[https://github.com/dieterich-lab/scimodom/issues/119][Annotation services]].
82+
- [ ] refactor :: Setup is not fully sorted: the case of import tables and ~IMPORT_DIR~, /cf./ [[https://github.com/dieterich-lab/scimodom/issues/126][startup]] and [[https://github.com/dieterich-lab/scimodom/issues/116][directory permission]],
83+
is still to be addressed.
15084

151-
- [X] Biotype mapping: how to? Write into table, and use only mapping, or map on the fly?
152-
- [X] ~Datatable dataKey="id"~
153-
- [X] Default ordering of data (Search, Browse, Compare). EUF import does not need to be sorted. Sorting is done on the fly for annotation.
154-
Default sort order in Search + sorting enabled. No default sort in Browse. For Compare, data is returned after sorting for intersect,
155-
closest, or subtract.
85+
- [ ] docs :: Update GitHub installation instructions, /e.g./ add instructions how to create project/data for testing, add dumps for testing,
86+
import tables, /etc/. Some instructions are wrong, for instance the ~pip install~ command misses the "dot". How to mock login (login may be
87+
tricky /e.g./ with google accounts)?
88+
89+
- [ ] validation :: Project or dataset title is a ~VARCHAR(255)~. Form validation is done in the client, but should be systematically implemented
90+
for the API (and include other fields with constraints, see also [[https://github.com/dieterich-lab/scimodom/issues/152][Not all API endpoints are fine]]).
91+
The CLI validates title for dataset, but not for project, metadata, or batch.
92+
93+
- [ ] forms :: When adding more than 1 metadata sheet, the assembly is reset, also resetting the model. This is not critical,
94+
since the user is requested to confirm the assembly as input anyway, but maybe this can be simplified?
95+
- [ ] forms :: Add lazy validation to form fields, in particular for login/sign up? Check also strict, see https://github.com/jquense/yup
96+
- [ ] forms :: Do not load the full ~yup~ package. Customize validation (login /vs./ sign up) and revisit messages. See
97+
/e.g./ https://tailwind.primevue.org/inputtext/#helptext. Classes are wrong, there is no ~p-error~, /etc./
98+
99+
- [ ] store :: Import/use pinia before router. Options /vs./ Composition. Add pinia as argument to router ~beforeEach~. Check =ways-to-use-pinia=.
156100

157101
*** TODO FEATURE REQUEST [0/2]
158102

Diff for: server/environment.yml

-125
This file was deleted.

0 commit comments

Comments
 (0)