meta-edc 1.5.0__py3-none-any.whl → 1.5.2__py3-none-any.whl

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.

Potentially problematic release.


This version of meta-edc might be problematic. Click here for more details.

@@ -6,6 +6,8 @@ from edc_pdutils.dataframes import get_eos, get_subject_consent, get_subject_vis
6
6
 
7
7
  from meta_subject.models import Glucose, GlucoseFbg
8
8
 
9
+ pd.set_option("future.no_silent_downcasting", True)
10
+
9
11
 
10
12
  def get_glucose_df(subject_identifiers: list[str] | None = None) -> pd.DataFrame:
11
13
  subject_visit_df = (
@@ -52,6 +54,9 @@ def get_glucose_df(subject_identifiers: list[str] | None = None) -> pd.DataFrame
52
54
  how="left",
53
55
  )
54
56
 
57
+ for col in [c for c in df_glucose_fbg.columns if "datetime" in c]:
58
+ df_glucose_fbg[col] = pd.to_datetime(df_glucose_fbg[col])
59
+
55
60
  if subject_identifiers:
56
61
  df_glucose = read_frame(
57
62
  Glucose.objects.filter(subject_visit__subject_identifier__in=subject_identifiers),
@@ -70,6 +75,9 @@ def get_glucose_df(subject_identifiers: list[str] | None = None) -> pd.DataFrame
70
75
  )
71
76
  df_glucose["source"] = "meta_subject.glucose"
72
77
 
78
+ for col in [c for c in df_glucose.columns if "datetime" in c]:
79
+ df_glucose[col] = pd.to_datetime(df_glucose[col])
80
+
73
81
  df_glucose = subject_visit_df[
74
82
  [
75
83
  "subject_identifier",
@@ -108,7 +116,6 @@ def get_glucose_df(subject_identifiers: list[str] | None = None) -> pd.DataFrame
108
116
  df_glucose_fbg[keep_cols],
109
117
  on="subject_visit_id",
110
118
  how="outer",
111
- # indicator=True,
112
119
  suffixes=("", "_2"),
113
120
  )
114
121
 
@@ -127,9 +134,16 @@ def get_glucose_df(subject_identifiers: list[str] | None = None) -> pd.DataFrame
127
134
  f"ogtt_units{suffix}",
128
135
  ] = "mmol/L (millimoles/L)"
129
136
 
137
+ for col in [c for c in df.columns if "datetime" in c]:
138
+ df[col] = pd.to_datetime(df[col])
139
+
140
+ df[[col for col in df.columns if "datetime" in col]] = df[
141
+ [col for col in df.columns if "datetime" in col]
142
+ ].apply(lambda x: x.dt.tz_localize(None) if x.dtype == "datetime64[ns, UTC]" else x)
143
+
130
144
  # reconcile all to single column
131
145
  for col in ["fasted", "fbg_value", "ogtt_value", "fbg_datetime", "ogtt_datetime"]:
132
- df.loc[(df[col].isna()) & (df[f"{col}_2"].notna()), col] = df[f"{col}_2"]
146
+ df[col] = df[col].fillna(df[f"{col}_2"])
133
147
 
134
148
  df_consent = get_subject_consent("meta_consent.subjectconsent")
135
149
  df_eos = get_eos("meta_prn.endofstudy")
@@ -143,10 +157,6 @@ def get_glucose_df(subject_identifiers: list[str] | None = None) -> pd.DataFrame
143
157
  how="left",
144
158
  )
145
159
 
146
- df[[col for col in df.columns if "datetime" in col]] = df[
147
- [col for col in df.columns if "datetime" in col]
148
- ].apply(lambda x: x.dt.tz_localize(None) if x.dtype == "datetime64[ns, UTC]" else x)
149
-
150
160
  df["visit_days"] = df["baseline_datetime"].rsub(df["visit_datetime"]).dt.days
151
161
  df["fgb_days"] = df["baseline_datetime"].rsub(df["fbg_datetime"]).dt.days
152
162
  df["ogtt_days"] = df["baseline_datetime"].rsub(df["ogtt_datetime"]).dt.days
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meta-edc
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: META Trial EDC (https://www.isrctn.com/ISRCTN76157257)
5
5
  Keywords: django,clinicedc,META EDC,EDC,clinical trials,META Trial,ISRCTN76157257
6
6
  Author: Erik van Widenfelt, Jonathan Willitts
@@ -89,8 +89,8 @@ Assuming you are logged into the account ``myaccount``:
89
89
  mkdir ~/edc && \
90
90
  cd ~/edc && \
91
91
  uv venv && \
92
- uv pip install -U meta-edc==1.4.1 && \
93
- wget https://raw.githubusercontent.com/meta-trial/meta-edc/1.4.1/manage.py && \
92
+ uv pip install -U meta-edc==1.5.1 && \
93
+ wget https://raw.githubusercontent.com/meta-trial/meta-edc/1.5.1/manage.py && \
94
94
  uv pip freeze | grep meta-edc
95
95
 
96
96
  Copy your ``.env`` file to ``~/.etc``.
@@ -140,7 +140,7 @@ From the above example:
140
140
 
141
141
  cd ~/edc && \
142
142
  uv venv --clear && \
143
- uv pip install -U meta-edc==1.4.1 && \
143
+ uv pip install -U meta-edc==1.5.1 && \
144
144
  wget -O manage.py https://raw.githubusercontent.com/meta-trial/meta-edc/1.1.10/manage.py && \
145
145
  uv pip freeze | grep meta-edc && \
146
146
  python manage.py check
@@ -84,7 +84,7 @@ meta_analytics/constants.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
84
  meta_analytics/dataframes/__init__.py,sha256=naGZtYGJ8BW03XslsFPZe9VZ2fWuU9ew84BB_iBLWxo,1266
85
85
  meta_analytics/dataframes/constants.py,sha256=oA0a9N7RzYstXuZXWclUjrbsWvNQbv1F4P9lFGlNRRg,937
86
86
  meta_analytics/dataframes/get_eos_df.py,sha256=N_7A_Io3KCGj8mrMjUfYP7w6gi7_2Dx2RSG6orQTWp4,1226
87
- meta_analytics/dataframes/get_glucose_df.py,sha256=eGzA7dxh3igGZdNKvMfiH7maRl2IAngWiQp9Dx8FZHU,5884
87
+ meta_analytics/dataframes/get_glucose_df.py,sha256=4WOu5rmVxB3E-Gflwlinl0qfzeNPTzvIitOGY7hwegg,6244
88
88
  meta_analytics/dataframes/get_glucose_fbg_df.py,sha256=yAshgtc_R6Q41p5iA9n7a_W0llp1JRsnj3NGQE6kVRk,898
89
89
  meta_analytics/dataframes/get_glucose_fbg_ogtt_df.py,sha256=BfMU1sNj1a4dVOy7yKGESARpb3SNTFxLA-BVB5oZ14Q,657
90
90
  meta_analytics/dataframes/get_last_imp_visits_df.py,sha256=N5tL6gANDr_g5AuNVv_cEN4U-QktLxJUAJaUIW2MiWs,3818
@@ -1158,7 +1158,7 @@ meta_visit_schedule/visit_schedules/phase_three/schedule.py,sha256=LU1HRaV6o1UeK
1158
1158
  meta_visit_schedule/visit_schedules/phase_three/schedule_dm_referral.py,sha256=q12p5wXc2D7lSiJVBnoSQw8Q3vL6uDx1t3PuDJO-Z-U,1735
1159
1159
  meta_visit_schedule/visit_schedules/phase_three/schedule_pregnancy.py,sha256=bEpbpCX3vfZmnsqudr0z8PU5kiaX4ws1sO5Im98Mo28,1106
1160
1160
  meta_visit_schedule/visit_schedules/phase_three/visit_schedule.py,sha256=ak4qazeKlpIlvpqrK9hDDO0fwWuWyvb4Ec-JU31IJxc,654
1161
- meta_edc-1.5.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
1162
- meta_edc-1.5.0.dist-info/WHEEL,sha256=ZHijuPszqKbNczrBXkSuoxdxocbxgFghqnequ9ZQlVk,79
1163
- meta_edc-1.5.0.dist-info/METADATA,sha256=gfx4FujUAmAv6WqApfCMhDVLqRmytRrBd4Zjp2G3RFQ,5162
1164
- meta_edc-1.5.0.dist-info/RECORD,,
1161
+ meta_edc-1.5.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
1162
+ meta_edc-1.5.2.dist-info/WHEEL,sha256=ZHijuPszqKbNczrBXkSuoxdxocbxgFghqnequ9ZQlVk,79
1163
+ meta_edc-1.5.2.dist-info/METADATA,sha256=obgIfLrCBL7boOhiRrCm9fAFpOVHsWanM3Z7GzmVSkg,5162
1164
+ meta_edc-1.5.2.dist-info/RECORD,,