s6mike / argmap

Tools for visualising argument maps represented in YAML - combining 2 forked repos with additional bugfixes and customisation.
https://argview.org/
Other
4 stars 1 forks source link

mup2argmap: bad argument #1 to 'for iterator' (table expected, got nil) #13

Open s6mike opened 2 years ago

s6mike commented 2 years ago

Although this worked fine: lua mup2argmap Output/example.mup > Output/example1.yml

This didn't: lua mup2argmap Input/Example1_ClearlyFalse_WhiteSwan.mup > Output/WhiteSwan.yml

- lua: ./mup2argmap:34: bad argument 1 to 'for iterator' (table expected, got nil)
- stack traceback:
  - [C]: in function 'next'
  - ./mup2argmap:34: in function 'parse_claims'
  - ./mup2argmap:65: in function 'parse_reasons'
  - ./mup2argmap:43: in function 'parse_claims'
  - ./mup2argmap:65: in function 'parse_reasons'
  - ./mup2argmap:43: in function 'parse_claims'
  - ./mup2argmap:65: in function 'parse_reasons'
  - ./mup2argmap:43: in function 'parse_claims'
  - ./mup2argmap:65: in function 'parse_reasons'
  - ./mup2argmap:43: in function 'parse_claims'
  - ./mup2argmap:111: in function 'main'
  - ./mup2argmap:129: in main chunk
  - [C]: in ?
s6mike commented 2 years ago

If mup2argmap wrote to file incrementally, might be easier to debug, could look at output file?

s6mike commented 2 years ago

For 'The colour of doves and seagulls is not relevant to the colour of swans.'

Looks like type should be opposing, but isn't?

Opposing part it is 3 level, rather than 1. But perhaps it's working as it should

  "3": {
                            "title": "group",
                            "id": "111.39c0.20fcbfa62-22a5.8d66050d3",
                            "attr": {
                                "contentLocked": true,
                                "group": "opposing"
                            },
"ideas": {
                                "1": {
                                    "title": "The colour of doves and seagulls is not relevant to the colour of swans.",
                                    "id": "112.39c0.20fcbfa62-22a5.8d66050d3",
                                    "attr": {}
                                },
                                "2": {
                                    "title": "These statements do not logically lead to the conclusion that all swans are white.",
                                    "id": "90.284b.9e18170f5-2dfc.554a800f5",
                                    "attr": {},
                                    "ideas": {}
                                }
                            }
                        },
s6mike commented 2 years ago

Error thrown by line 65: parse_claims(items["ideas"], strength, label)

Error thrown by line 34: local claims = parse_claims(items["ideas"], strength, label)

Label: X
key:o1

id:
'14.7233.0a46019f3-35f8.fe2f2c911'
ideas:
{1=...}
title:
'This black swan is a photo-shopped fake.'

/home/s6mike/git_projects/argmap/mup2argmap:34: bad argument #1 to 'for iterator' (table expected, got nil)

s6mike commented 2 years ago

Try removing 'This black swan is a photo-shopped fake.' from map then export

s6mike commented 2 years ago

Removing the within argument objections, plus the note added to the objection, seems to fix issue. See https://drive.mindmup.com/map/1FY98eeanu9vAhIqBG1rDKFs3QyM1uQyY, which works.

Also see: Example1_ClearlyFalse_WhiteSwan_minus_inline_objections in which I think I've included everything I can from the original example without throwing an error.

Though output is still a bit flakey in places:

All swans are white.:
  r**-1**:
    label: supports (+)
    These swans are representative of all swans.:
      o5:
        label: X
        **? |-**
          # Logical Fallacy

          Observing individuals doesn't prove anything about the whole population.
        : note: Observing individuals doesn't prove anything about the whole population.
    Every swan I've ever seen is white.:
      r1:
        label: +
        Here is a photo of another white swan.: []
        Here is a photo of a white swan.:
          r1: []
  o1:
    label: rejects (X)
    strength: 5
    Not all swans are white.:
      r1:
        label: +
        strength: 5
        **? |-**
          This is a photo of a black swan from Australia.

          https://en.wikipedia.org/wiki/Black_swan
        : o1:
            label: X
            This black swan is a photo-shopped fake.: []
  r2:
    label: supports (+)
    strength: 1
    Every seagull I've ever seen is white. :
      o3:
        label: X
        This isn't relevant to the argument of whether all swans are white.: []
    Every dove I've ever seen is white.:
      o1:
        label: X
        This colour of doves is not relevant to the colour of swans.: []
...
s6mike commented 2 years ago

Running argmap2mup on above gave a file which didn't work in mindmup, but produced this using legacy mapjs: image

Issues: has encoding errors. Otherwise - missing images, but no structural differences.

s6mike commented 2 years ago

Similar (and more recent):

m2a test/input/mapjs-json/example2-clearly-false-white-swan-v3.mup
lua: /opt/miniconda3/envs/argmap/bin/mup2argmap:53: bad argument #1 to 'for iterator' (table expected, got nil)
stack traceback:
        [C]: in function 'next'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:53: in function 'parse_claims'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:87: in function 'parse_reasons'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:62: in function 'parse_claims'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:87: in function 'parse_reasons'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:62: in function 'parse_claims'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:133: in function 'main'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:152: in main chunk
        [C]: in ?