CasperWA / voila-optimade-client

Import structures in AiiDA lab using OPTIMADE
MIT License
3 stars 7 forks source link

[BUG] - Missing updates on first chosen database #64

Closed CasperWA closed 4 years ago

CasperWA commented 4 years ago

Bug description

Upon choosing the first provider/database nothing happens.

Expected behaviour (optional)

For a provider with only a single database, it should be chosen and the database dropdown should be disabled. For a provider with multiple databases, when a database is chosen, several requests should be sent to the database in order to update the filter inputs.

Actual behavior (optional)

Nothing happens until the second provider/database is chosen.

Reproducibility (optional)

Restart the application and try it out.

For developers (do not alter this section)

Log dump ``` ... [DEBUG 12:45:13 utils.py:202] Base URL found to be None for provider: id='pcod' type='provider' links=None meta=None attributes=LinksResourceAttributes(name='Predicted Crystallography Open Database', description='', base_url=None, homepage=None) relationships=None [DEBUG 12:45:14 utils.py:211] Could not determine versioned base URL for provider: id='tcod' type='provider' links=None meta=None attributes=LinksResourceAttributes(name='Theoretical Crystallography Open Database', description='Open-access collection of theoretically calculated or refined crystal structures of organic, inorganic, metal-organic compounds and minerals, excluding biopolymers', base_url=AnyUrl('https://www.crystallography.net/tcod/optimade', scheme='https', host='www.crystallography.net', tld='net', host_type='domain', path='/tcod/optimade'), homepage=AnyUrl('https://www.crystallography.net/tcod', scheme='https', host='www.crystallography.net', tld='net', host_type='domain', path='/tcod')) relationships=None [DEBUG 12:45:14 provider_database.py:572] Provider changed in summary. New value: None [DEBUG 12:45:14 provider_database.py:581] Database changed in summary. New value: None [DEBUG 12:45:14 informational.py:144] Trying image file path: /home/ubuntu/img/optimade-text-right-transparent-bg.png [DEBUG 12:45:54 provider_database.py:572] Provider changed in summary. New value: LinksResourceAttributes(name='Materials Cloud', description='A platform for Open Science built for seamless sharing of resources in computational materials science', base_url='https://www.materialscloud.org/optimade/v0', homepage=AnyUrl('https://www.materialscloud.org', scheme='https', host='www.materialscloud.org', tld='org', host_type='domain')) [DEBUG 12:45:54 provider_database.py:190] Initializing child DBs for Materials Cloud. [DEBUG 12:45:54 utils.py:88] Performing OPTIMADE query: https://www.materialscloud.org/optimade/v0/links?response_format=json&page_limit=10&page_offset=0 [DEBUG 12:45:54 provider_database.py:483] First attempt for 'Materials Cloud' (in /links): Found implementations (names+base_url only): ['id: autowannier; base_url: https://dev-aiida-dev.materialscloud.org/autowannier/optimade', 'id: curated-cofs; base_url: https://dev-aiida-dev.materialscloud.org/curated-cofs/optimade', 'id: optimade-sample; base_url: https://dev-aiida-dev.materialscloud.org/optimade-sample/optimade', 'id: 3dd; base_url: https://dev-aiida-dev.materialscloud.org/3dd/optimade', 'id: hcofs-co2; base_url: https://dev-aiida-dev.materialscloud.org/hcofs-co2/optimade'] [DEBUG 12:45:54 provider_database.py:219] Found the following, which has now been cached: {'child_dbs': [('Automated high-throughput Wannierisation', LinksResourceAttributes(name='Automated high-throughput Wannierisation', description='Validation results of an automated protocol for generating maximally-localized Wannier functions in a high-throughput framework.', base_url='https://dev-aiida-dev.materialscloud.org/autowannier/optimade/v0', homepage=AnyUrl('https://materialscloud.org/discover/autowannier', scheme='https', host='materialscloud.org', tld='org', host_type='domain', path='/discover/autowannier'))), ('CURATED covalent organic frameworks database', LinksResourceAttributes(name='CURATED covalent organic frameworks database', description='Database of experimentally reported Covalent-Organic Frameworks (COFs), provided with DFT-optimized geometry and DDEC partial charges for molecular simulations.', base_url='https://dev-aiida-dev.materialscloud.org/curated-cofs/optimade/v0', homepage=AnyUrl('https://materialscloud.org/discover/curated-cofs', scheme='https', host='materialscloud.org', tld='org', host_type='domain', path='/discover/curated-cofs'))), ('OPTIMADE Sample Database', LinksResourceAttributes(name='OPTIMADE Sample Database', description='Database with example structures for OPTIMADE tests.', base_url='https://dev-aiida-dev.materialscloud.org/optimade-sample/optimade/v0', homepage=AnyUrl('https://materialscloud.org', scheme='https', host='materialscloud.org', tld='org', host_type='domain'))), ('Three-dimensional crystals database', LinksResourceAttributes(name='Three-dimensional crystals database', description='Curated set of relaxed three-dimensional crystal structures based on raw CIF data from the experimantal databases MPDS, COD, and ICSD.', base_url='https://dev-aiida-dev.materialscloud.org/3dd/optimade/v0', homepage=AnyUrl('https://materialscloud.org', scheme='https', host='materialscloud.org', tld='org', host_type='domain'))), ('COFs for CO2 capture and storage applications', LinksResourceAttributes(name='COFs for CO2 capture and storage applications', description='A curated set of COFs with the highest Henry coefficient for CO2, where the full CO2 and N2 isotherm and the parasitic energy for the process have been computed.', base_url='https://dev-aiida-dev.materialscloud.org/hcofs-co2/optimade/v0', homepage=AnyUrl('https://materialscloud.org', scheme='https', host='materialscloud.org', tld='org', host_type='domain')))], 'data_returned': 5, 'links': {'next': None}} [DEBUG 12:45:57 provider_database.py:581] Database changed in summary. New value: LinksResourceAttributes(name='Three-dimensional crystals database', description='Curated set of relaxed three-dimensional crystal structures based on raw CIF data from the experimantal databases MPDS, COD, and ICSD.', base_url='https://dev-aiida-dev.materialscloud.org/3dd/optimade/v0', homepage=AnyUrl('https://materialscloud.org', scheme='https', host='materialscloud.org', tld='org', host_type='domain')) [DEBUG 12:45:57 query_filter.py:246] Parameters (excluding filter) sent to query util func: {'base_url': None, 'page_limit': 10, 'page_offset': 0} ```
CasperWA commented 4 years ago

This seems to be working fine in the latest develop version.