146 Commits

Author SHA1 Message Date
3a69b8d4ff
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
2024-10-01 14:29:26 +00:00
bb149d1137 chore(deps): update postgres docker tag to v17 (#98)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| postgres | major | `16.4-alpine` -> `17.0-alpine` |

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4zOS42IiwidXBkYXRlZEluVmVyIjoiMzguMzkuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: #98
Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Co-committed-by: renovate-bot <renovate-bot@dubas.dev>
2024-10-01 14:28:44 +00:00
7c15e1fae6
chore: execute dialyzer with short format
All checks were successful
continuous-integration/drone/pr Build is passing
2024-09-26 00:32:44 +00:00
8328bbe9fb
merge: updates from tracking
All checks were successful
continuous-integration/drone/pr Build is passing
2024-09-25 23:48:32 +00:00
90613635fb
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
Conflicts:
    .gitignore
    lib/wabanex/application.ex
    mix.lock
2024-09-22 19:06:02 +00:00
9be7566cbb feat: execute service as distributed erlang (#96)
All checks were successful
continuous-integration/drone/push Build is passing
To create a cluster with distributed nodes, the following changes were made:

* Use [`dns_cluster`][0] to execute distributed nodes
* Add _script_ to execute distributed nodes locally

Also, improve local execution by:

* Use [`mix release`][1] to make easier [deploy `phoenix`][2]
* Use [`compose watch`][3] to synchronize code from the host with the service

Some minor improvements:

* Ignore files and folders in git and docker
* Remove boilerplate comments

[0]: https://github.com/phoenixframework/dns_cluster
[1]: https://hexdocs.pm/mix/Mix.Tasks.Release.html
[2]: https://hexdocs.pm/phoenix/releases.html
[3]: https://docs.docker.com/compose/how-tos/file-watch/

Co-authored-by: Joao P Dubas <joao.dubas@gmail.com>
Reviewed-on: #96
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-09-22 18:56:27 +00:00
0a4e262b91 chore(deps): update dependency erlang to v27.1 (#95)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [erlang](https://github.com/erlang/otp) | minor | `27.0.1` -> `27.1` |

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4zOS42IiwidXBkYXRlZEluVmVyIjoiMzguMzkuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: #95
Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Co-committed-by: renovate-bot <renovate-bot@dubas.dev>
2024-09-20 13:07:08 +00:00
bcdabe41c3 chore(deps): update dependency elixir to v1.17.3 (#81)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [elixir](https://elixir-lang.org/) ([source](https://github.com/elixir-lang/elixir)) | patch | `1.17.2-otp-27` -> `1.17.3` |

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNjIuMSIsInVwZGF0ZWRJblZlciI6IjM4LjM5LjYiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Reviewed-on: #81
Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Co-committed-by: renovate-bot <renovate-bot@dubas.dev>
2024-09-19 18:07:20 +00:00
dc6e00d54b
chore: ignore elixir tools folder
All checks were successful
continuous-integration/drone/pr Build is passing
2024-09-18 11:49:23 +00:00
5c044e69d9
fix(growth): use centile and percentile correctly
1. The calculation made in `Grownth.Calc.Centile.compute/4` converts a
   given z-score into the expected measurement value.
   This can be used to get specific values for key z-scores, such as,
   -3, -2, 2 and 3.
2. To calculate the percentile of a given z-score the system uses the
   cumulative distribution function.
2024-08-28 13:03:45 +00:00
824a70452f
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
2024-08-13 14:17:32 +00:00
4d545074f5 chore(deps): update postgres docker tag to v16.4 (#90)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| postgres | minor | `16.3-alpine` -> `16.4-alpine` |

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Reviewed-on: #90
Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Co-committed-by: renovate-bot <renovate-bot@dubas.dev>
2024-08-13 14:09:16 +00:00
b696cc129d
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
Conflicts:
    mix.exs
    mix.lock
2024-08-12 20:19:36 +00:00
4195fc615f feat: upgrade application dependencies (#93)
All checks were successful
continuous-integration/drone/push Build is passing
[Upgrade deps][0]:

* `absinthe` from 1.7.7 to 1.7.8
* `ecto` from 3.11.2 to 3.12.0
* `ecto_sql` from 3.11.3 to 3.12.0
* `gettext` from 0.24.0 to 0.25.0
* `jason` from 1.4.3 to 1.4.4
* `mix_audit` from 2.1.3 to 2.1.4
* `postgrex` from 0.18.0 to 0.19.0
* `prom_ex` from 1.9.0 to 1.10.0
* `telemetry_metrics` from 0.6.2 to 1.0.0

Install transient deps:

* `peep` to 3.2.0

Reviewed-on: #93

[0]: https://diff.hex.pm/diffs?diffs[]=absinthe:1.7.7:1.7.8&diffs[]=ecto:3.11.2:3.12.0&diffs[]=ecto_sql:3.11.3:3.12.0&diffs[]=gettext:0.24.0:0.25.0&diffs[]=jason:1.4.3:1.4.4&diffs[]=mix_audit:2.1.3:2.1.4&diffs[]=postgrex:0.18.0:0.19.0&diffs[]=prom_ex:1.9.0:1.10.0&diffs[]=telemetry_metrics:0.6.2:1.0.0
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-08-12 20:08:18 +00:00
c923b2efb7
test(growth): work on age calculation
All checks were successful
continuous-integration/drone/pr Build is passing
2024-07-12 11:18:40 +00:00
8e9907a3e8
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
2024-07-12 11:15:30 +00:00
39fd238ed8 feat: upgrade erlang and deps (#87)
All checks were successful
continuous-integration/drone/push Build is passing
* Upgrade erlang to 27.0.1
* Upgrade abisnthe to 1.7.7

Reviewed-on: #87
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-07-12 11:12:50 +00:00
3914bd5240
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
2024-07-08 21:55:02 +00:00
2fa1a773f2 feat(ci): improve dependency graph (#84)
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #84
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-07-08 21:54:20 +00:00
8dffb86d01
chore(deps): update deps of deps
All checks were successful
continuous-integration/drone/pr Build is passing
2024-07-08 21:36:37 +00:00
866730238e
feat(deps): upgrade req from 0.5.0 to 0.5.2 2024-07-08 21:28:35 +00:00
eeb6964348
merge: updates from upstream
Conflicts:
    mix.lock
2024-07-08 21:25:21 +00:00
3f83808335 feat: upgrade elixir and erlang runtimes, and deps (#83)
All checks were successful
continuous-integration/drone/push Build is passing
Upgrade runtimes:

* [erlang from 26.2.5 to 27.0][0]
* [elixir from 1.16.3 to 1.17.1][1]

Upgrade dependencies:

* `castore` [from 1.0.6 to 1.0.8](https://diff.hex.pm/diff/castore/1.0.6..1.0.8)
* `cowboy` [from 2.10.0 to 2.12.0](https://diff.hex.pm/diff/cowboy/2.10.0..2.12.0)
* `cowlib` [from 2.12.1 to 2.13.0](https://diff.hex.pm/diff/cowlib/2.12.1..2.13.0)
* `credo` [from 1.7.6 to 1.7.7](https://diff.hex.pm/diff/credo/1.7.6..1.7.7)
* `db_connection` [from 2.6.0 to 2.7.0](https://diff.hex.pm/diff/db_connection/2.6.0..2.7.0)
* `ecto_sql` [from 3.11.2 to 3.11.3](https://diff.hex.pm/diff/ecto_sql/3.11.2..3.11.3)
* `erlex` [from 0.2.6 to 0.2.7](https://diff.hex.pm/diff/erlex/0.2.6..0.2.7)
* `hpax` [from 0.1.2 to 1.0.0](https://diff.hex.pm/diff/hpax/0.1.2..1.0.0)
* `jason` [from 1.4.1 to 1.4.3](https://diff.hex.pm/diff/jason/1.4.1..1.4.3)
* `mime` [from 2.0.5 to 2.0.6](https://diff.hex.pm/diff/mime/2.0.5..2.0.6)
* `mint` [from 1.5.2 to 1.6.2](https://diff.hex.pm/diff/mint/1.5.2..1.6.2)
* `nimble_options` [from 1.1.0 to 1.1.1](https://diff.hex.pm/diff/nimble_options/1.1.0..1.1.1)
* `nimble_pool` [from 1.0.0 to 1.1.0](https://diff.hex.pm/diff/nimble_pool/1.0.0..1.1.0)
* `phoenix` [from 1.7.12 to 1.7.14](https://diff.hex.pm/diff/phoenix/1.7.12..1.7.14)
* `phoenix_ecto` [from 4.6.1 to 4.6.2](https://diff.hex.pm/diff/phoenix_ecto/4.6.1..4.6.2)
* `phoenix_live_dashboard` [from 0.8.3 to 0.8.4](https://diff.hex.pm/diff/phoenix_live_dashboard/0.8.3..0.8.4)
* `phoenix_live_view` [from 0.20.14 to 0.20.17](https://diff.hex.pm/diff/phoenix_live_view/0.20.14..0.20.17)
* `phoenix_view` [from 2.0.3 to 2.0.4](https://diff.hex.pm/diff/phoenix_view/2.0.3..2.0.4)
* `plug` [from 1.15.3 to 1.16.1](https://diff.hex.pm/diff/plug/1.15.3..1.16.1)
* `plug_crypto` [from 2.0.0 to 2.1.0](https://diff.hex.pm/diff/plug_crypto/2.0.0..2.1.0)
* `telemetry_metrics_prometheus_core` [from 1.2.0 to 1.2.1](https://diff.hex.pm/diff/telemetry_metrics_prometheus_core/1.2.0..1.2.1)
* `websock_adapter` [from 0.5.5 to 0.5.6](https://diff.hex.pm/diff/websock_adapter/0.5.5..0.5.6)
* `yaml_elixir` [from 2.9.0 to 2.11.0](https://diff.hex.pm/diff/yaml_elixir/2.9.0..2.11.0)

To make `graphql` work with the newer `erlang` and `elixir`, the `absinthe` is installed directly from github:

* [`absinthe`](358e273a26)
* [`absinthe_plug`](3a984cc341)

Finally, the `ci` routine was simplified, so test + lint is executed in parallel, and more core is reused.

[0]: https://www.erlang.org/news/170
[1]: https://github.com/elixir-lang/elixir/releases/tag/v1.17.1

Reviewed-on: #83
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-07-08 21:04:26 +00:00
0d7a4cc9c3
chore(growth): move nil logic to scorer behaviour
All checks were successful
continuous-integration/drone/pr Build is passing
Handle `nil` measurement in `Growth.Score.Scorer`.
2024-06-11 14:53:19 +00:00
7fab746ea8
feat: add ex_doc to generate documentation
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-11 12:18:18 +00:00
c81e4fda67
chore(growth): add log in loader
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-11 12:02:14 +00:00
bc9c2124f1
chore(growth): add example for Growth.new/4 2024-06-11 12:01:50 +00:00
c14a26a184
fix(growth): measure for subscapular skinfold 2024-06-11 12:01:25 +00:00
79aec9f7e5
feat(growth): calculate z-score/centile for all indicators
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-11 11:42:57 +00:00
2545a796c3
chore(growth): return nil when measure isn't set 2024-06-11 11:42:17 +00:00
88b8e811a8
chore(growth): apply scorer behaviour in indicators 2024-06-11 11:41:31 +00:00
fa022b9592
feat(growth): calculate z-score/centile for all indicators
The `Growth.Score.Scorer` behaviour implements the methods needed to
calculate z-score and centile for any indicator.
2024-06-11 11:38:18 +00:00
0ac434c61d
fix(growth): ignore enum result explicitly
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-10 19:24:41 +00:00
06b35cbceb
wip(growth): implement results for bmi
Some checks failed
continuous-integration/drone/pr Build is failing
This implementation should be made generic for all other scores.
2024-06-10 19:09:35 +00:00
28f0546bcb
chore(growth): add default value for results 2024-06-10 18:35:12 +00:00
c175c3edfd
fix(growth): typespec and doc for centile calc 2024-06-10 18:34:24 +00:00
4234b2e917
chore(growth): load is independent from task
Some checks failed
continuous-integration/drone/pr Build is failing
Ensure that `Growth.Indicators.Load.all/0` can be run independently from
the task.

So, the `ets` table is create based on the filename processed.
2024-06-10 13:01:44 +00:00
04fff60541
wip(growth): add score module
Some checks failed
continuous-integration/drone/pr Build is failing
This module is responsible for calculate the z score/centile for each
measurement.
2024-06-10 12:15:16 +00:00
b415b38184
feat(growth): load data on application start
To make this possible, the following changes were made:

* Use `Task` to start the load process
* Create `ets` table before start the async task
  * This is needed to keep the tables alive after the task process exits
* Adjust the application to start the `Growth.Indicators.Load` task
2024-06-10 12:11:18 +00:00
412250d7ef
feat(growth): add struct to represent measurement
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-09 20:00:49 +00:00
d3c1aa9b6b
chore(growth): improve age documentation and typing 2024-06-09 19:59:33 +00:00
025ab1537d
chore(growth): name ets tables with score modules 2024-06-09 19:58:34 +00:00
52c1d0c028
feat(growth): load csv indicators into ets tables
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-07 13:28:13 +00:00
902a22c947
chore(growth): fetch extended data for indicators
All checks were successful
continuous-integration/drone/pr Build is passing
Also, improve module doc.
2024-06-06 22:49:52 +00:00
a8466f0c1d
chore(growth): add documentation and examples
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-06 20:39:10 +00:00
Joao P Dubas
bb79aa2f3a fix(growth): alias z-score and use if
Some checks failed
continuous-integration/drone/pr Build is failing
2024-06-06 11:34:02 +00:00
500d0e89bb
wip(growth): calculate key metrics for growth
Some checks failed
continuous-integration/drone/pr Build is failing
1. calculate age in days, weeks, and months
2. calculate body mass index for metric and english unities
3. calculate z-score for a given measurement and box-cox parameters (l,
   m, s)
4. calculate centile score for a given measurement and box-cox
   parameters
2024-06-06 01:36:11 +00:00
8be9fa38bb
wip(growth): add fix note on convert/3 method
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-04 23:56:27 +00:00
9c8e1d20ee
wip(growth): improve data parsing
1. Fetch common data for all indicators
2. Remove headers during merge

Also, re-generate files.
2024-06-04 23:55:03 +00:00
2fedb4ecf0
wip(growth): change from with to case
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-04 14:36:20 +00:00