Skip to content

Commit

Permalink
leaderboard update in notebook in case it does not work in iirhub
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekToma committed Feb 23, 2024
1 parent e853c8b commit 43b151f
Showing 1 changed file with 190 additions and 31 deletions.
221 changes: 190 additions & 31 deletions notebooks/cranfield.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"id": "inUAfc6TQMVJ"
},
Expand All @@ -59,7 +59,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"id": "fyAqWIQyINng"
},
Expand Down Expand Up @@ -103,7 +103,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"id": "HfRrW7O6U5wb"
},
Expand All @@ -118,11 +118,25 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"id": "DkeKUsWWWnb9"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<Document 1 “experimental investigation of the aerodynamics of ...”>\n",
"<Document 2 “simple shear flow past a flat plate in an incompre ...”>\n",
"<Document 3 “the boundary layer in simple shear flow past a fla ...”>\n",
"...\n",
"<Document 1398 “stability of rectangular plates under shear and be ...”>\n",
"<Document 1399 “buckling of transverse stiffened plates under shea ...”>\n",
"<Document 1400 “the buckling shear stress of simply-supported infi ...”>\n"
]
}
],
"source": [
"print('\\n'.join(repr(document) for document in list(documents.values())[:3]))\n",
"print('...')\n",
Expand All @@ -131,56 +145,99 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {
"id": "kvsnuhT3ZZAo"
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"<Document 14 “piston theory - a new aerodynamic tool for the aer ...”>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"document = documents['14']\n",
"document"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {
"id": "e-zw68v5Xoh5"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ashley,h. and zartarian,g.\n"
]
}
],
"source": [
"print(document.authors)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {
"id": "p13FfuduZSRK"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"j. ae. scs. 23, 1956, 1109.\n"
]
}
],
"source": [
"print(document.bibliography)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {
"id": "z5bmj4WzZc9e"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"piston theory - a new aerodynamic tool for the aeroelastician .\n"
]
}
],
"source": [
"print(document.title)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {
"id": "W3z7ed8SZkn6"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"piston theory - a new aerodynamic tool for the aeroelastician . representative applications are described which illustrate the extent to which simplifications in the solutions of high-speed unsteady aeroelastic problems can be achieved through the use of certain aerodynamic techniques known collectively as /piston theory ./ based on a physical model originally proposed by hayes and lighthill, piston theory for airfoils and finite wings has been systematically developed by landahl, utilizing expansions in powers of the thickness ratio and the inverse of the flight mach number m . when contributions of orders and are negligible, the theory predicts a point-function relationship between the local pressure on the surface of a wing and the normal component of fluid velocity produced by the wing's motion . the computation of generalized forces in aeroelastic equations, such as the flutter determinant, is then always reduced to elementary integrations of the assumed modes of motion . essentially closed-form solutions are given for the bending- torsion and control-surface flutter properties of typical section airfoils at high mach numbers . these agree well with results of more exact theories wherever comparisons can be fairly made . moreover, they demonstrate the increasingly important influence of thickness and profile shape as m grows larger, a discovery that would be almost impossible using other available aerodynamic tools . the complexity of more practical flutter analyses-e.g., on three-dimensional wings and panels-is shown to be substantially reduced by piston theory . an iterative procedure is outlined, by which improved flutter eigenvalues can be found through the successive introduction of higher-order terms in and . other applications to unsteady supersonic problems are reviewed, including gust response and rapid maneuvers of elastic aircraft . steady-state aeroelastic calculations are also discussed, but for them piston theory amounts only to a slight modification of ackeret's formulas . suggestions are made regarding future research based on the new aerodynamic method, with particular emphasis on areas where computational labor can be reduced with a minimum loss of precision . it is pointed out that a mach number zone exists where thermal effects are appreciable but nonlinear viscous interactions may be neglected, and that in this zone piston theory is the logical way of estimating air loads when analyzing aerodynamic- thermoelastic interaction problems .\n"
]
}
],
"source": [
"print(document.body)"
]
Expand All @@ -197,7 +254,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {
"id": "oaCFkMFdKjST"
},
Expand Down Expand Up @@ -235,7 +292,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {
"id": "8qcyQUNRqRTr"
},
Expand All @@ -246,11 +303,25 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"metadata": {
"id": "IW-N6g3LqwPZ"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<Query 12 “how can the aerodynamic performance of channel flo ...”>\n",
"<Query 31 “what size of end plate can be safely used to simul ...”>\n",
"<Query 84 “references on the methods available for accurately ...”>\n",
"...\n",
"<Query 16 “can the transverse potential flow about a body of ...”>\n",
"<Query 78 “has anyone explained the kink in the surge line of ...”>\n",
"<Query 146 “does a membrane theory exist by which the behaviou ...”>\n"
]
}
],
"source": [
"print('\\n'.join(repr(query) for query in list(queries.values())[:3]))\n",
"print('...')\n",
Expand All @@ -259,23 +330,42 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"metadata": {
"id": "VgdHjSYIq5HV"
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"<Query 14 “papers on shock-sound wave interaction .”>"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"query = queries[14]\n",
"query"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 14,
"metadata": {
"id": "w4NGZOdOq8NF"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"papers on shock-sound wave interaction .\n"
]
}
],
"source": [
"print(query.body)"
]
Expand All @@ -296,11 +386,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"metadata": {
"id": "HRqgBUnh9IP8"
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Building the dictionary: 100%|██████████| 1400/1400 [00:00<00:00, 10483.10it/s]\n",
"Building the index: 100%|██████████| 1400/1400 [00:00<00:00, 9804.44it/s]\n"
]
}
],
"source": [
"from pv211_utils.systems import BoWSystem\n",
"from pv211_utils.preprocessing import NoneDocPreprocessing\n",
Expand All @@ -321,24 +420,84 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"metadata": {
"id": "ssX-nvxGu3JK"
},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"Your system achieved **17.44% MAP score**."
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"You need at least **22%** to pass. 😢"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"Try playing with the preprocessing of queries and documents! 💡"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"Set `submit_result = True` and write your name to the `author_name` variable to submit your result to [the leaderboard](https://docs.google.com/spreadsheets/d/e/2PACX-1vQga_qzgcLp_IcrOt5xZBq4Pq7jjTwmV6JLMRPwkLwG3K3dm2FrcZT-1GhGItFkNyAxwDaOzzFLOIdu/pubhtml). 🏆\n",
"\n",
"The best submissions on the leaderboard will receive *small awards during the semester*, and some *__seriously big__ awards* after the personal check at the end of the competition (2024-03-19). Please be polite, do not spoil the game for the others, and **have fun!** 😉"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from pv211_utils.cranfield.loader import load_judgements\n",
"from pv211_utils.cranfield.leaderboard import CranfieldLeaderboard\n",
"from pv211_utils.cranfield.eval import CranfieldEvaluation\n",
"\n",
"submit_result = False\n",
"author_name = 'Surname, Name'\n",
"submit_result = False \n",
"author_name = 'Toma, Marek'\n",
"\n",
"test_judgements = load_judgements(queries, documents)\n",
"leaderboard = CranfieldLeaderboard()\n",
"leaderboard._get_spreadsheet_key = lambda: '1K_GnmMTjeacPaUmvjO79abrlqOV8JqvnoxoQICulpAw'\n",
"leaderboard.get_public_url = lambda: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQga_qzgcLp_IcrOt5xZBq4Pq7jjTwmV6JLMRPwkLwG3K3dm2FrcZT-1GhGItFkNyAxwDaOzzFLOIdu/pubhtml'\n",
"evaluation = CranfieldEvaluation(system, test_judgements, leaderboard=leaderboard, author_name=author_name)\n",
"evaluation.evaluate(queries, submit_result)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -364,11 +523,11 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.9.14"
},
"vscode": {
"interpreter": {
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
"hash": "97b31d6e62de2216a05dd9342162045e53cee058ed98d00a361b193ba69cab9f"
}
}
},
Expand Down

0 comments on commit 43b151f

Please sign in to comment.