Skip to content

Conversation

Copy link

Copilot AI commented Dec 12, 2025

Implements a lookup table system for B&W film development timing, dilution, and temperature. C41 timing remains unchanged (roll-count based calculation).

Implementation

Database Model

  • DevelopmentChart table with unique constraint on (film_stock, developer, iso_rating, dilution_ratio, temperature_celsius)
  • Computed property formats seconds → MM:SS display
  • Auto-creates table on startup

API Endpoints (/api/dev-chart)

  • CRUD operations with filtering/pagination
  • POST /lookup - Query by parameters, returns exact match or suggestions
  • GET /autocomplete/{films,developers} - Typeahead support
  • Race condition protection via IntegrityError catch-and-rollback

Data Seeding

  • CSV import script with MM:SS time format support
  • Pre-seeded 34 combinations (Ilford HP5+/FP4+/Delta, Kodak Tri-X/T-Max, Fomapan)
  • Covers common developers: Ilfosol 3, D-76, HC-110, Rodinal
  • Push/pull processing via multiple ISO entries per film

Usage

# Lookup dev time for HP5+ pushed to ISO 800
curl -X POST http://localhost:8200/api/dev-chart/lookup \
  -d '{"film_stock":"Ilford HP5 Plus 400","developer":"Ilfosol 3","iso_rating":800}'
# → {"found": true, "entry": {..., "development_time_formatted": "11:00"}}

# Import CSV data
python migration/scripts/import_dev_chart.py \
  migration/data/dev_chart_seed.csv --db-path backend/data/emulsion.db

Testing

18 integration tests covering CRUD, lookup logic, filtering, pagination, and duplicate prevention.

Original prompt

First read the readme to understand current setup. Then Start a new plan on adding a development-"chart" (but more of a backend/database/lookup tables) for tracking timing, dilution, and temperature required for development. Eventually we will wire its functionality to the front end so it gives the information. Maybe even a chemistry timer widget.

Considerations:
We only plan on supporting two types of chemistry for now: BW and C41. But the timing calculation for C41 is kind of already primitively done using number of existing rolls. And C41 is a standard process where dev time is consistent across all C41 films

So most of our focus would be BW, because permutations of developer and film has different timing and dilution and temperature. For example, for Ilford HP5 films, and if I use Ilfosol 3, it will be 6:30 for iso400, but if I push 1 stop, it'll be 11 minutes. This assumes dilution ratio of 1+4, if it's 1+9, iso 400 will take 8 minutes or something. The point is, there's a lot of input variables to a single output (dev time) and the simplest way I think about is a lookup table.

Then we need to plan out how this can fit into our existing framework. I'd like the ability to quickly add new datapoints from experiment or from reading chemistry data sheets.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 7 commits December 12, 2025 00:37
- Created DevelopmentChart model for B&W film dev timing lookup
- Added Pydantic schemas for request/response validation
- Implemented CRUD API endpoints at /api/dev-chart
- Added lookup endpoint for finding dev times by film/developer/ISO
- Included autocomplete endpoints for film stocks and developers
- Database table auto-created on startup

Co-authored-by: FSXAC <7558835+FSXAC@users.noreply.github.com>
- Created 18 test cases covering all CRUD operations
- Test filtering by film stock, developer, and ISO rating
- Test lookup functionality with exact matches and suggestions
- Test autocomplete endpoints for films and developers
- Test pagination and development time formatting
- All tests passing successfully

Co-authored-by: FSXAC <7558835+FSXAC@users.noreply.github.com>
- Created import_dev_chart.py script for bulk data import
- Added dev_chart_seed.csv with 34 common film/developer combinations
- Includes Ilford HP5+, FP4+, Delta series with various developers
- Includes Kodak Tri-X, T-Max with D-76, HC-110, and T-Max Developer
- Supports push/pull processing with multiple ISO ratings
- Script handles MM:SS time format conversion
- Tested import and API endpoints successfully

Co-authored-by: FSXAC <7558835+FSXAC@users.noreply.github.com>
- Added Development Chart section to features
- Documented all dev-chart API endpoints
- Added CSV import instructions with format examples
- Updated database tables list
- Included information about 34 pre-seeded combinations

Co-authored-by: FSXAC <7558835+FSXAC@users.noreply.github.com>
- Created examples/dev_chart_demo.py demonstrating API usage
- Shows how to lookup dev times for specific combinations
- Demonstrates push processing lookup (ISO 800)
- Shows search and filtering by film stock
- Includes helper for MM:SS to seconds conversion
- Tested successfully with all examples working

Co-authored-by: FSXAC <7558835+FSXAC@users.noreply.github.com>
… handling

- Added database-level unique constraint to prevent duplicate entries
- Fixed race condition by catching IntegrityError in create endpoint
- Improved time parsing robustness (handles decimals, better error messages)
- Removed duplicate time parsing logic in import script
- Increased temperature limit to 100°C for broader process support
- All tests passing with improved data integrity

Co-authored-by: FSXAC <7558835+FSXAC@users.noreply.github.com>
Copilot AI changed the title [WIP] Add backend chart for tracking development timing and dilution Add B&W film development chart lookup system Dec 12, 2025
Copilot AI requested a review from FSXAC December 12, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants