You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_sources/developer/deprecating.rst
+105Lines changed: 105 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,79 @@ To semiautomatically deprecate a published version of C-PAC, follow these steps:
14
14
In a local clone or copy of |CPAC-Development|_:
15
15
16
16
#. Replace the critical alert in |CRITICAL_ALERT.rst|_ with the ``CRITICAL_ALERT`` from step one, above.
17
+
#. Update |cpac_pipeline.py|_ and |run.py|_:
18
+
#. Overwrite the current versions in the |CPAC-Development/deprecate|_ with the versions from the source code of the version of C-PAC to deprecate.
19
+
#. Add
20
+
21
+
.. code:: Python
22
+
23
+
shutil.copyfile('/CRITICAL_ALERT.rst',
24
+
os.path.join(log_dir, 'CRITICAL_ALERT.rst'))
25
+
26
+
to |cpac_pipeline.py|_ after
27
+
28
+
.. code:: Python
29
+
30
+
ifnot os.path.exists(log_dir):
31
+
os.makedirs(os.path.join(log_dir))
32
+
33
+
(e.g., |cpac_pipeline.py example 1|_) and make sure ``shutil`` is imported before calling that library.
34
+
35
+
#. Also in |cpac_pipeline.py|_, update the variable ``execution_info`` to include ``{critical_alert}`` at the end, like |cpac_pipeline.py example 2|_:
36
+
37
+
.. code:: Python
38
+
39
+
execution_info ="""
40
+
41
+
End of subject workflow {workflow}
42
+
43
+
CPAC run complete:
44
+
45
+
Pipeline configuration: {pipeline}
46
+
Subject workflow: {workflow}
47
+
Elapsed run time (minutes): {elapsed}
48
+
Timing information saved in {log_dir}/cpac_individual_timing_{pipeline}.csv
49
+
System time of start: {run_start}
50
+
System time of completion: {run_finish}
51
+
52
+
{critical_alert}
53
+
"""
54
+
55
+
.. note::
56
+
57
+
There are probably at least two definitions of ``execution_info`` that need ``{critical_alert}`` appended to them (e.g., |cpac_pipeline.py example 3|_).
58
+
59
+
#. Also in |cpac_pipeline.py|_, define ``critical_alert`` based on the |CRITICAL_ALERT.rst|_ file you already updated (e.g., |cpac_pipeline.py example 4|_):
60
+
61
+
.. code:: Python
62
+
63
+
withopen('/CRITICAL_ALERT.rst', 'r') as critical_alert_file:
64
+
critical_alert ='\n'.join([
65
+
f'{line.rstrip()}'for line in critical_alert_file.readlines()])
66
+
67
+
#. Also in |cpac_pipeline.py|_, update any calls to ``execution_info.format()`` to populate the string variable ``{critical_alert}`` with the ``critical_alert`` you defined above (e.g., |cpac_pipeline.py example 5|_):
0 commit comments