From 85b5b79bf07b7477e95cfe9dbd38a58f94b1bf3e Mon Sep 17 00:00:00 2001 From: Nikolas Nyby Date: Thu, 8 Aug 2024 13:39:31 -0400 Subject: [PATCH] Remove unused graph fields alpha and omega - #3368 These fields were apparently planned to be used for a graph type but it looks like nothing is actually using them, so we can remove them. --- econplayground/api/serializers.py | 3 --- ...0_remove_graph_alpha_remove_graph_omega.py | 21 +++++++++++++++++++ econplayground/main/models.py | 6 ------ media/js/src/GraphEditor.jsx | 2 -- media/js/src/GraphMapping.js | 12 ----------- media/js/src/GraphViewer.jsx | 2 -- media/js/src/JXGBoard.jsx | 4 +--- 7 files changed, 22 insertions(+), 28 deletions(-) create mode 100644 econplayground/main/migrations/0120_remove_graph_alpha_remove_graph_omega.py diff --git a/econplayground/api/serializers.py b/econplayground/api/serializers.py index 64b3646b1..2a1f6a9b2 100644 --- a/econplayground/api/serializers.py +++ b/econplayground/api/serializers.py @@ -117,9 +117,6 @@ class Meta: 'line_4_offset_y', 'line_4_dashed', - 'alpha', - 'omega', - 'a1', 'a1_name', 'a1_min', 'a1_max', 'a2', 'a2_name', 'a2_min', 'a2_max', 'a3', 'a3_name', 'a3_min', 'a3_max', diff --git a/econplayground/main/migrations/0120_remove_graph_alpha_remove_graph_omega.py b/econplayground/main/migrations/0120_remove_graph_alpha_remove_graph_omega.py new file mode 100644 index 000000000..d3229b79b --- /dev/null +++ b/econplayground/main/migrations/0120_remove_graph_alpha_remove_graph_omega.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.15 on 2024-08-08 17:40 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0119_alter_graph_graph_type'), + ] + + operations = [ + migrations.RemoveField( + model_name='graph', + name='alpha', + ), + migrations.RemoveField( + model_name='graph', + name='omega', + ), + ] diff --git a/econplayground/main/models.py b/econplayground/main/models.py index 1ff1cd418..f2068333a 100644 --- a/econplayground/main/models.py +++ b/econplayground/main/models.py @@ -255,12 +255,6 @@ class Meta(OrderedModel.Meta): line_4_label = models.TextField(blank=True, null=True, default='') line_4_dashed = models.BooleanField(default=False) - # TODO: migrate these to a1, a2, etc. - alpha = models.DecimalField( - max_digits=12, decimal_places=4, default=Decimal('0.3')) - omega = models.DecimalField( - max_digits=12, decimal_places=4, default=Decimal('0')) - # Arbitrary number storage to be used as needed for the altering # functions of the various graph types. # diff --git a/media/js/src/GraphEditor.jsx b/media/js/src/GraphEditor.jsx index 8a59275d8..ace44eade 100644 --- a/media/js/src/GraphEditor.jsx +++ b/media/js/src/GraphEditor.jsx @@ -455,8 +455,6 @@ GraphEditor.propTypes = { gAssignmentType: PropTypes.number, gNeedsSubmit: PropTypes.bool, - gAlpha: PropTypes.number, - gA1: PropTypes.number, gA1Name: PropTypes.string, gA1Max: PropTypes.number, diff --git a/media/js/src/GraphMapping.js b/media/js/src/GraphMapping.js index 514f5289f..805bf1224 100644 --- a/media/js/src/GraphMapping.js +++ b/media/js/src/GraphMapping.js @@ -63,9 +63,6 @@ const exportGraph = function(state) { line_3_dashed: state.gLine3Dashed, line_4_dashed: state.gLine4Dashed, - alpha: forceFloat(state.gAlpha), - omega: forceFloat(state.gOmega), - a1: forceFloat(state.gA1), a1_name: state.gA1Name, a1_max: forceFloat(state.gA1Max), @@ -231,9 +228,6 @@ const convertGraph = function(json) { gLine3Dashed: json.line_3_dashed, gLine4Dashed: json.line_4_dashed, - gAlpha: forceFloat(json.alpha), - gOmega: forceFloat(json.omega), - gA1: forceFloat(json.a1), gA1Name: json.a1_name, gA1Max: forceFloat(json.a1_max), @@ -387,9 +381,6 @@ const importGraph = function(json, obj, callback=null) { gLine3Dashed: json.line_3_dashed, gLine4Dashed: json.line_4_dashed, - gAlpha: forceFloat(json.alpha), - gOmega: forceFloat(json.omega), - gA1: forceFloat(json.a1), gA1Name: json.a1_name, gA1Max: forceFloat(json.a1_max), @@ -568,9 +559,6 @@ const defaultGraph = { gXAxis2Label: '', gYAxis2Label: '', - gAlpha: 0.3, - gOmega: 1, - gA1: null, gA1Name: '', gA1Min: 0, diff --git a/media/js/src/GraphViewer.jsx b/media/js/src/GraphViewer.jsx index e34ca25e4..278245dd7 100644 --- a/media/js/src/GraphViewer.jsx +++ b/media/js/src/GraphViewer.jsx @@ -519,8 +519,6 @@ GraphViewer.propTypes = { gLine2Dashed: PropTypes.bool.isRequired, gLine3Dashed: PropTypes.bool.isRequired, - gAlpha: PropTypes.number, - gA1: PropTypes.number, gA1Name: PropTypes.string, gA1Initial: PropTypes.number, diff --git a/media/js/src/JXGBoard.jsx b/media/js/src/JXGBoard.jsx index 3ec8c9b76..8c5e21aa0 100644 --- a/media/js/src/JXGBoard.jsx +++ b/media/js/src/JXGBoard.jsx @@ -305,7 +305,7 @@ export default class JXGBoard extends React.Component { 'gLine2OffsetYInitial', 'gLine3OffsetX', 'gLine3OffsetY', 'gLine3OffsetXInitial', 'gLine3OffsetYInitial', 'gLine4OffsetX', 'gLine4OffsetY', 'gLine4OffsetXInitial', 'gLine4OffsetYInitial', - 'gLine1Dashed', 'gLine2Dashed', 'gLine3Dashed', 'gAlpha', + 'gLine1Dashed', 'gLine2Dashed', 'gLine3Dashed', 'gA1', 'gA1Initial', 'gA1Name', 'gA2', 'gA2Initial', 'gA2Name', @@ -842,8 +842,6 @@ JXGBoard.propTypes = { gLine2Dashed: PropTypes.bool, gLine3Dashed: PropTypes.bool, - gAlpha: PropTypes.number, - gA1: PropTypes.number, gA1Initial: PropTypes.number, gA2: PropTypes.number,