Skip to content

Fix wrong logical operator#2

Open
eungbean wants to merge 1 commit into
gbaier:mainfrom
eungbean:patch-1
Open

Fix wrong logical operator#2
eungbean wants to merge 1 commit into
gbaier:mainfrom
eungbean:patch-1

Conversation

@eungbean

Copy link
Copy Markdown

To test that RGB, DEM and Seg. are there,
the logical operator should be and, nor or.

example:
if there are
476_5767_rgb.jp2, 476_5767_dem.tif, 476_5767_seg.tif files in bielefeld/ folder,
then triplet is formed as below:

group=['476_5767_rgb.jp2', '476_5767_dem.tif', '476_5767_seg.tif']

len(group)=3

and

if len(group) != 3 or len(group) != 4:
    print('missing a file in {}: {}'.format(city.name, [g.name for g in group]))

operation produces always True.
So I fix it as below.

if len(group) != 3 and len(group) != 4:
    print('missing a file in {}: {}'.format(city.name, [g.name for g in group]))

To test that RGB, DEM and Seg. are there,
the logical operator should be ``and``, nor ``or``.

example:
if there are 
'476_5767_rgb.jp2', '476_5767_dem.tif', '476_5767_seg.tif' files in ``bielefeld`` folder,
then triplet is formed as below:
```python
group=['476_5767_rgb.jp2', '476_5767_dem.tif', '476_5767_seg.tif']

len(group)=3
```
and ``if len(group) != 3 or len(group) != 4:`` operation produces always True.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant