{ "cells": [ { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "nlines 295\n" ] }, { "ename": "OSError", "evalue": "[Errno 36] File name too long: '/home/studen/software/src/PBPK/lnnCoeficients20/2.99 0.238417637086984388797613728837827840 0.100507477009604154836100438824822336 6.28937166958104021511906850948531379e-0002 4.58998347060752074479672420771387218e-0002 3.64700264643633901148996298170523232e-0002 3.06425717856179304700949998965563635e-0002 2.68215093790101049226609557028999965e-0002 2.42489885477285958810455496236520476e-0002 2.25267778673815624077005952838261520e-0002 2.14340391559021950228443258304712224e-0002 2.08487229470702947197446492704332186e-0002 2.07115561199676023035432862447672556e-0002 2.10105325482895012068658735799710670e-0002 2.17776720368081296561303502513017583e-0002 2.30958337594438907003106904276748294e-0002 2.51162698557232480020316619593432452e-0002 2.80842217491055684669052681520168191e-0002 3.23201232404783565853566680380960896e-0002 3.76195595689774823186914396276037700e-0002 3.57447376482966512356629625005809230e-0002 288.187355755832978206678140906757921 53.3116377447714517439616537386053209 21.1761751132239210404952170497955705 11.0662200518665686718860536408739141 6.64261975894393601684900849619823099 4.32394251034057961822655898211825843 2.96136597718428853524597809420283795 2.09516737609792330807934046082498862 1.51233117342670571984502562208066988 1.10324048276750433788517810166175422 0.806862318915068346239655132916590617 0.587073033323485297294671491383962004 0.421435573602802546106108853785550945 0.295472608317866446066383547730981939 0.199564695935899058852382040342832643 0.127186151152267518405478362174209318 7.38598691800891781650664032941228926e-0002 3.65129987249978463547551866036109886e-0002 1.30458949108874482527495367751484684e-0002 1.88562798553405246327856069850025596e-0003'", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mOSError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mfdir\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexpanduser\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'~'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'software'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'src'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'PBPK'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'lnnCoeficients20'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mparseCoefficients\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mparseCoefficients\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'test.out'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;32m~/software/src/PBPK/pythonScripts/parseCoefficients.py\u001b[0m in \u001b[0;36mparseCoefficients\u001b[0;34m(fdir, out)\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[0moutlines\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'nlines {}'\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutlines\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 25\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'w'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 26\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwrite\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'\\n'\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutlines\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mOSError\u001b[0m: [Errno 36] File name too long: '/home/studen/software/src/PBPK/lnnCoeficients20/2.99 0.238417637086984388797613728837827840 0.100507477009604154836100438824822336 6.28937166958104021511906850948531379e-0002 4.58998347060752074479672420771387218e-0002 3.64700264643633901148996298170523232e-0002 3.06425717856179304700949998965563635e-0002 2.68215093790101049226609557028999965e-0002 2.42489885477285958810455496236520476e-0002 2.25267778673815624077005952838261520e-0002 2.14340391559021950228443258304712224e-0002 2.08487229470702947197446492704332186e-0002 2.07115561199676023035432862447672556e-0002 2.10105325482895012068658735799710670e-0002 2.17776720368081296561303502513017583e-0002 2.30958337594438907003106904276748294e-0002 2.51162698557232480020316619593432452e-0002 2.80842217491055684669052681520168191e-0002 3.23201232404783565853566680380960896e-0002 3.76195595689774823186914396276037700e-0002 3.57447376482966512356629625005809230e-0002 288.187355755832978206678140906757921 53.3116377447714517439616537386053209 21.1761751132239210404952170497955705 11.0662200518665686718860536408739141 6.64261975894393601684900849619823099 4.32394251034057961822655898211825843 2.96136597718428853524597809420283795 2.09516737609792330807934046082498862 1.51233117342670571984502562208066988 1.10324048276750433788517810166175422 0.806862318915068346239655132916590617 0.587073033323485297294671491383962004 0.421435573602802546106108853785550945 0.295472608317866446066383547730981939 0.199564695935899058852382040342832643 0.127186151152267518405478362174209318 7.38598691800891781650664032941228926e-0002 3.65129987249978463547551866036109886e-0002 1.30458949108874482527495367751484684e-0002 1.88562798553405246327856069850025596e-0003'" ] } ], "source": [ "import parseCoefficients\n", "import os\n", "\n", "fdir=os.path.join(os.path.expanduser('~'),'software','src','PBPK','lnnCoeficients20')\n", "parseCoefficients.parseCoefficients(fdir,'test.out')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 4 }