Commit 6c00e22
authored
Adiciona suporte para datas de preprint em FulltextDates (#1052)
* feat(dates): add preprint_date support to FulltextDates
- Add cached_property preprint_date to extract preprint date from history
- Include preprint dates in get_peer_reviewed_stats method
- Calculate days_from_preprint_to_received and days_from_preprint_to_published
- Add estimation flags for preprint-related intervals
- Support serialization of preprint_date when serialize_dates=True
* test(dates): add comprehensive tests for preprint_date functionality
- Add TestPreprintDate class with tests for:
- Preprint date extraction when present
- Behavior when preprint date is absent
- Partial preprint dates (year and month only)
- Multiple preprint dates (first one is selected)
- Add TestGetPeerReviewedStatsWithPreprint class with tests for:
- Complete peer review cycle including preprint
- Preprint with estimated dates
- Only preprint and published dates scenario
- Custom default values for partial preprint dates
- Date serialization with preprint
- Negative intervals for out-of-order dates
- Fix leap year calculations (2024 has 366 days)
- Correct day count from Dec 15, 2023 to Mar 1, 2024 (77 days)1 parent 4c21fa4 commit 6c00e22
2 files changed
Lines changed: 405 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
418 | 431 | | |
419 | 432 | | |
420 | 433 | | |
| |||
444 | 457 | | |
445 | 458 | | |
446 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
447 | 465 | | |
448 | 466 | | |
449 | 467 | | |
| |||
460 | 478 | | |
461 | 479 | | |
462 | 480 | | |
| 481 | + | |
463 | 482 | | |
464 | 483 | | |
465 | 484 | | |
466 | 485 | | |
467 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
468 | 492 | | |
469 | 493 | | |
470 | 494 | | |
| |||
480 | 504 | | |
481 | 505 | | |
482 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
483 | 511 | | |
484 | 512 | | |
485 | 513 | | |
| |||
490 | 518 | | |
491 | 519 | | |
492 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
493 | 528 | | |
494 | 529 | | |
495 | 530 | | |
| |||
0 commit comments